node: update node tests

Review feedback from @pires
This commit is contained in:
Jeff Schroeder 2024-04-19 09:46:45 -04:00
parent 98432b3520
commit ae3eed09a5
1 changed files with 6 additions and 2 deletions

View File

@ -840,8 +840,12 @@ func runConsensusTests(t *testing.T, testCases []testCase, numGuardians int) {
<-rootCtx.Done()
assert.NotEqual(t, rootCtx.Err(), context.DeadlineExceeded)
zapLogger.Info("Test root context cancelled, waiting 10ms for everything to shut down properly...")
time.Sleep(time.Millisecond * 50)
// There are some things that happen outside of the supervisor context and are a bit racey when the root context
// is shutdown. Namely some pkg/db bits, metrics sinks, and p2p logging. This gives them time to shutdown so the
// tests are happy.
wait := 50
zapLogger.Info("Test root context cancelled, waiting %dms for everything to shut down properly...", wait)
time.Sleep(time.Millisecond * wait)
}
type testCaseGuardianConfig struct {