Skip to content

Commit

Permalink
Merge pull request containerd#5727 from dmcgowan/test-monitor-restart…
Browse files Browse the repository at this point in the history
…-grace

Add timestamp to flaky restart monitor test
  • Loading branch information
estesp committed Jul 13, 2021
2 parents d527926 + 18321f5 commit 34fb8d8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions integration/client/restart_monitor_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ version = 2
task.Kill(ctx, syscall.SIGKILL)
begin := time.Now()
deadline := begin.Add(interval).Add(epsilon)
for time.Now().Before(deadline) {
for {
status, err := task.Status(ctx)
now := time.Now()
if err != nil {
Expand All @@ -97,10 +97,13 @@ version = 2
return
}
}
if time.Now().After(deadline) {
break
}
time.Sleep(epsilon)
}
t.Fatalf("the task was not restarted in %s + %s",
interval.String(), epsilon.String())
t.Fatalf("%v: the task was not restarted in %s + %s",
time.Now(), interval.String(), epsilon.String())
}

// withRestartStatus is a copy of "github.com/containerd/containerd/runtime/restart".WithStatus.
Expand Down

0 comments on commit 34fb8d8

Please sign in to comment.