When there is a timeout, we try to generate a timeout report by printing what timed out. There is a race in this logic which sometimes results in CI failures like this:
--- FAIL: TestAppStart/Timeout (0.01s)
9 app_test.go:905:
10 Error Trace: app_test.go:905
11 Error: "OnStart hook added by failed: context deadline exceeded" does not contain "OnStart hook added by go.uber.org/fx_test.TestAppStart.func1.1 failed: context deadline exceeded"
12 Test: TestAppStart/Timeout
13 FAIL
We can actually repro this pretty easily by changing the timeout in TestAppStart/Timeout to 1 nanosecond:
When there is a timeout, we try to generate a timeout report by printing what timed out. There is a race in this logic which sometimes results in CI failures like this:
We can actually repro this pretty easily by changing the timeout in TestAppStart/Timeout to 1 nanosecond: