Files
lukaszraczylo 3f11219dc1 test: drain healthcheck goroutine + lock read in HealthCallback test
CI on Linux flagged a race in TestStartWorker_HealthCallback_StatusChange:
the test read ui.updates while the healthchecker's per-port goroutine
(spawned by Register at checker.go:164) was still running and could
fire UpdateStatus through notifyStatusChange.

The earlier mutex on MockStatusUpdater protected the writes; the read
side was unprotected, and the goroutine had not finished by the time
the test started ranging over the slice on slower runners.

Fix:
  - call healthChecker.Unregister(fwd.ID()) to drain the per-port
    goroutine before reading
  - hold ui.mu around the slice read for belt-and-suspenders happens-
    before, regardless of goroutine timing

Verified locally with go test -race -count=20 on the targeted test
and -count=3 on the full forward package.
2026-05-06 18:24:38 +01:00
..