Skip to content

Commit

Permalink
Fix another flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdubbelboer committed Jun 2, 2024
1 parent e6d9374 commit 2909827
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,11 @@ func TestRejectedRequestsCount(t *testing.T) {
}
}

// The server's worker pool is a separate goroutine, give it
// a little bit of time to process the failed connection,
// otherwise the test may fail from time to time.
time.Sleep(time.Millisecond * 10)

if cnt := s.GetRejectedConnectionsCount(); cnt != uint32(expectedCount) {
t.Errorf("unexpected rejected connections count: %d. Expecting %d",
cnt, expectedCount)
Expand Down

0 comments on commit 2909827

Please sign in to comment.