Fix flaky tests

This commit is contained in:
Alejandro Durante
2021-07-10 11:06:33 -03:00
parent e20608949a
commit a8db74f50c
+5 -1
View File
@@ -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())