Skip to content

Commit 18321f5

Browse files
committed
Move loop check to before sleep
Signed-off-by: Derek McGowan <[email protected]>
1 parent 2e8a572 commit 18321f5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

integration/client/restart_monitor_linux_test.go

Lines changed: 4 additions & 1 deletion
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,6 +97,9 @@ version = 2
9797
return
9898
}
9999
}
100+
if time.Now().After(deadline) {
101+
break
102+
}
100103
time.Sleep(epsilon)
101104
}
102105
t.Fatalf("%v: the task was not restarted in %s + %s",

0 commit comments

Comments
 (0)