Tests that build an fx app with fxtest.New sent fx's own event log to t.Logf. When a start or stop runs past fx's time limit, Start or Stop returns while the hook carries on in a goroutine, and fx logs from that goroutine after the test has returned, which the race detector reports. Every fxtest.New (handlers, server, resetpw, gormlog, config) now passes fx.NopLogger, as fx's own tests do, so nothing fx runs can reach the test. Each of these apps was already stopped by a deferred or cleanup RequireStop before its test returns.
Not visible in the diff: fx's event log no longer appears in a failing test's output. A failed start or stop still reports its error through RequireStart or RequireStop.
Judgement call: the fxtest.NewLifecycle(t) sites are unchanged; they run hooks on the goroutine that calls Start or Stop, which is always the test or its cleanup.
Deviation from the plan: an app whose start overruns fx's time limit still has its hook running after the test fails; it no longer touches the test, and that limit is #225.
Deviation: no load was added and make test takes no repeat count, so the race-enabled suite ran twice under the host's own load, load average 45 to 72 on 48 cores.
Unverified: the original race was not reproduced before the fix; the fix follows from where fx's source makes that write.
Model: opus-5-5
Tests that build an fx app with `fxtest.New` sent fx's own event log to `t.Logf`. When a start or stop runs past fx's time limit, `Start` or `Stop` returns while the hook carries on in a goroutine, and fx logs from that goroutine after the test has returned, which the race detector reports. Every `fxtest.New` (handlers, server, resetpw, gormlog, config) now passes `fx.NopLogger`, as fx's own tests do, so nothing fx runs can reach the test. Each of these apps was already stopped by a deferred or cleanup `RequireStop` before its test returns.
Not visible in the diff: fx's event log no longer appears in a failing test's output. A failed start or stop still reports its error through `RequireStart` or `RequireStop`.
- Judgement call: the `fxtest.NewLifecycle(t)` sites are unchanged; they run hooks on the goroutine that calls `Start` or `Stop`, which is always the test or its cleanup.
- Deviation from the plan: an app whose start overruns fx's time limit still has its hook running after the test fails; it no longer touches the test, and that limit is https://git.eeqj.de/sneak/webhooker/issues/225.
- Deviation: no load was added and `make test` takes no repeat count, so the race-enabled suite ran twice under the host's own load, load average 45 to 72 on 48 cores.
- Unverified: the original race was not reproduced before the fix; the fix follows from where fx's source makes that write.
Model: opus-5-5
fxtest.New sends fx's event log to t.Logf. When a start or stop runs
past fx's time limit, Start or Stop returns while the hook keeps
running in a goroutine, and that goroutine logs to the test after the
test has returned, which the race detector reports. Every fxtest.New
now passes fx.NopLogger, so nothing fx runs can reach the test. The
fxtest.Lifecycle sites are unchanged: they run hooks on the goroutine
that calls Start or Stop, which is always the test or its cleanup.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Tests that build an fx app with
fxtest.Newsent fx's own event log tot.Logf. When a start or stop runs past fx's time limit,StartorStopreturns while the hook carries on in a goroutine, and fx logs from that goroutine after the test has returned, which the race detector reports. Everyfxtest.New(handlers, server, resetpw, gormlog, config) now passesfx.NopLogger, as fx's own tests do, so nothing fx runs can reach the test. Each of these apps was already stopped by a deferred or cleanupRequireStopbefore its test returns.Not visible in the diff: fx's event log no longer appears in a failing test's output. A failed start or stop still reports its error through
RequireStartorRequireStop.fxtest.NewLifecycle(t)sites are unchanged; they run hooks on the goroutine that callsStartorStop, which is always the test or its cleanup.make testtakes no repeat count, so the race-enabled suite ran twice under the host's own load, load average 45 to 72 on 48 cores.Model: opus-5-5
Review passed: this fixes #230 and is ready to merge into
next.Model: opus-5-5
Re-gate passed on current
next.Model: opus-5-5