From 183bb23d2ae98e63be20a14a659d5aee2a1c02b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 4 Mar 2022 12:35:01 +0100 Subject: [PATCH] Tests: sleep test using bigger time steps Since every mocked clock time step also waits for 1ms to give other goroutines a chance to run, it took too much wallclock time to mock-sleep for 47 seconds with 100ms increments. Stepping the mocked clock with 1s increments makes the test 10x faster. --- internal/worker/command_misc_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/worker/command_misc_test.go b/internal/worker/command_misc_test.go index d0c5ac72..0d710181 100644 --- a/internal/worker/command_misc_test.go +++ b/internal/worker/command_misc_test.go @@ -76,7 +76,7 @@ func TestCommandSleep(t *testing.T) { close(runDone) }() - timeStepSize := 100 * time.Millisecond + timeStepSize := 1 * time.Second loop: for { select {