Skip to content

Commit a8cc893

Browse files
internal/daemon: simplify time update tests
Using time.After makes the intent clearer
1 parent bf52575 commit a8cc893

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

internal/daemon/controller/testing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ func (tc *TestController) WaitForNextWorkerStatusUpdate(workerStatusName string)
941941
break
942942
}
943943

944-
if waitStatusCurrent.Sub(waitStatusStart) > 0 {
944+
if waitStatusCurrent.After(waitStatusStart) {
945945
break
946946
}
947947
}

internal/daemon/worker/status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func (w *Worker) WaitForNextSuccessfulStatusUpdate() error {
110110
return ctx.Err()
111111
}
112112

113-
if w.lastSuccessfulStatusTime().Sub(waitStatusStart) > 0 {
113+
if w.lastSuccessfulStatusTime().After(waitStatusStart) {
114114
break
115115
}
116116
}

internal/daemon/worker/worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ func (w *Worker) Shutdown() error {
715715
break
716716
}
717717

718-
if w.lastSuccessfulStatusTime().Sub(waitStatusStart) > 0 {
718+
if w.lastSuccessfulStatusTime().After(waitStatusStart) {
719719
break
720720
}
721721

0 commit comments

Comments
 (0)