Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Corentin Clabaut committed Jun 17, 2024
1 parent bdb616c commit 57e5a0a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pond_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ func TestPurgeAfterPoolStopped(t *testing.T) {
pool.SubmitAndWait(func() {
atomic.AddInt32(&doneCount, 1)
})

time.Sleep(10 * time.Millisecond)

assertEqual(t, int32(1), atomic.LoadInt32(&doneCount))
assertEqual(t, 1, pool.RunningWorkers())

Expand All @@ -59,6 +62,8 @@ func TestPurgeDuringSubmit(t *testing.T) {
atomic.AddInt32(&doneCount, 1)
})

time.Sleep(10 * time.Millisecond)

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

// Stop an idle worker right before submitting another task
Expand Down

0 comments on commit 57e5a0a

Please sign in to comment.