Skip to content

Commit 808956a

Browse files
authored
TestDataRace: Fix leak (#1081)
TestDataRace never calls App.Stop, which can cause a resource leak. This currently passes because of the implementation detail that Shutdowner.Shutdown happens to call signalReceivers.Stop instead of just Shutdown, which may not always be true.
1 parent 0316fd3 commit 808956a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shutdown_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func TestDataRace(t *testing.T) {
138138
t,
139139
fx.Populate(&s),
140140
)
141-
require.NoError(t, app.Start(context.Background()), "error starting app")
141+
defer app.RequireStart().RequireStop()
142142

143143
const N = 50
144144
ready := make(chan struct{}) // used to orchestrate goroutines for Done() and ShutdownOption()

0 commit comments

Comments
 (0)