From a8db74f50c240878a790930ba40a94ed5b0756d1 Mon Sep 17 00:00:00 2001 From: Alejandro Durante Date: Sat, 10 Jul 2021 11:06:33 -0300 Subject: [PATCH] Fix flaky tests --- pond_blackbox_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pond_blackbox_test.go b/pond_blackbox_test.go index d0311e5..0e7480b 100644 --- a/pond_blackbox_test.go +++ b/pond_blackbox_test.go @@ -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()) @@ -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()) } @@ -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())