From 9bfec3980b66aa05f0e94475af7911736f1275fb Mon Sep 17 00:00:00 2001 From: David Porter Date: Wed, 3 Nov 2021 14:04:02 -0700 Subject: [PATCH] test: Add grace period for restart monitor test restart monitor test was failing due to occasionally taking past the deadline on windows tests. Add a small additional grace period to deflake the test. Signed-off-by: David Porter --- integration/client/restart_monitor_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/integration/client/restart_monitor_test.go b/integration/client/restart_monitor_test.go index f17e98dfc..33d42273a 100644 --- a/integration/client/restart_monitor_test.go +++ b/integration/client/restart_monitor_test.go @@ -174,7 +174,11 @@ version = 2 begin := time.Now() - expected := begin.Add(interval).Add(epsilon) + // The restart is "truly" expected after (interval + epsilon), but due to some flakiness in CI, we give it a bit extra time. + // Specifically, we give an extra "grace period" of (count / 2) seconds. + expected := begin.Add(interval).Add(epsilon * (count / 2)) + + // Deadline determines when check for restart should be aborted. deadline := begin.Add(interval).Add(epsilon * count) for { status, err := task.Status(ctx)