Skip to content

Commit

Permalink
*: fix tests data race
Browse files Browse the repository at this point in the history
s.Shutdown() does not wait for all goroutines of the node server to
stop, which causes logs to attempt to write after the test has ended.

Signed-off-by: Ekaterina Pavlova <[email protected]>
  • Loading branch information
AliceInHunterland committed Feb 15, 2024
1 parent ea23772 commit be9ce6c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/network/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ func startWithCleanup(t *testing.T, s *Server) {
go s.Start()
t.Cleanup(func() {
s.Shutdown()
require.Eventually(t, func() bool { return s.log.Sync() == nil }, 2*time.Second, time.Millisecond*500)
})
}

Expand Down

0 comments on commit be9ce6c

Please sign in to comment.