Skip to content

Commit

Permalink
Fix flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alitto committed Jul 10, 2021
1 parent e206089 commit a8db74f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pond_blackbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ func TestSubmitToIdle(t *testing.T) {
time.Sleep(1 * time.Millisecond)
})

time.Sleep(10 * time.Millisecond)

assertEqual(t, int(1), pool.RunningWorkers())
assertEqual(t, int(1), pool.IdleWorkers())

Expand All @@ -216,6 +218,8 @@ func TestSubmitToIdle(t *testing.T) {

pool.StopAndWait()

time.Sleep(10 * time.Millisecond)

assertEqual(t, int(0), pool.RunningWorkers())
assertEqual(t, int(0), pool.IdleWorkers())
}
Expand Down Expand Up @@ -315,7 +319,7 @@ func TestPoolWithCustomIdleTimeout(t *testing.T) {
completed <- true

// Wait for some time
time.Sleep(10 * time.Millisecond)
time.Sleep(50 * time.Millisecond)

// Worker should have been killed
assertEqual(t, 0, pool.RunningWorkers())
Expand Down

0 comments on commit a8db74f

Please sign in to comment.