Skip to content

Commit

Permalink
test: Add grace period for restart monitor test
Browse files Browse the repository at this point in the history
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 <porterdavid@google.com>
  • Loading branch information
bobbypage committed Nov 3, 2021
1 parent 0478e04 commit 9bfec39
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion integration/client/restart_monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9bfec39

Please sign in to comment.