Skip to content

Commit 34fb8d8

Browse files
authored
Merge pull request #5727 from dmcgowan/test-monitor-restart-grace
Add timestamp to flaky restart monitor test
2 parents d527926 + 18321f5 commit 34fb8d8

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

integration/client/restart_monitor_linux_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ version = 2
8181
task.Kill(ctx, syscall.SIGKILL)
8282
begin := time.Now()
8383
deadline := begin.Add(interval).Add(epsilon)
84-
for time.Now().Before(deadline) {
84+
for {
8585
status, err := task.Status(ctx)
8686
now := time.Now()
8787
if err != nil {
@@ -97,10 +97,13 @@ version = 2
9797
return
9898
}
9999
}
100+
if time.Now().After(deadline) {
101+
break
102+
}
100103
time.Sleep(epsilon)
101104
}
102-
t.Fatalf("the task was not restarted in %s + %s",
103-
interval.String(), epsilon.String())
105+
t.Fatalf("%v: the task was not restarted in %s + %s",
106+
time.Now(), interval.String(), epsilon.String())
104107
}
105108

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

0 commit comments

Comments
 (0)