Discard fx's own log in tests that build an fx app (closes #230)
check / check (push) Waiting to run

Every test that builds an fx app with fxtest.New (handlers, server, resetpw, gormlog, config) now passes fx.NopLogger, so fx's own log no longer goes to t.Logf. A hook still running after a start or stop timeout can then no longer write to a test that has already returned, which the race detector reported as a data race. What the tests assert is unchanged, and nothing about the race detector is suppressed.

Model: opus-5-5
This commit was merged in pull request #426.
This commit is contained in:
2026-10-02 11:08:38 +02:00
parent 5b1d283d06
commit 2bb4683512
5 changed files with 28 additions and 0 deletions
+4
View File
@@ -104,6 +104,10 @@ func newTestEnvWithConfig(
app := fxtest.New(
t,
// fx's own log is discarded, not sent to t.Logf: a hook still
// running after a start or stop timeout would write there after
// the test has returned.
fx.NopLogger,
fx.Provide(
globals.New,
logger.New,