Skip to content

Commit

Permalink
internal/daemon: simplify time update tests
Browse files Browse the repository at this point in the history
Using time.After makes the intent clearer
  • Loading branch information
johanbrandhorst committed Aug 23, 2024
1 parent bf52575 commit a8cc893
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/daemon/controller/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ func (tc *TestController) WaitForNextWorkerStatusUpdate(workerStatusName string)
break
}

if waitStatusCurrent.Sub(waitStatusStart) > 0 {
if waitStatusCurrent.After(waitStatusStart) {
break
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/daemon/worker/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (w *Worker) WaitForNextSuccessfulStatusUpdate() error {
return ctx.Err()
}

if w.lastSuccessfulStatusTime().Sub(waitStatusStart) > 0 {
if w.lastSuccessfulStatusTime().After(waitStatusStart) {
break
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/daemon/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ func (w *Worker) Shutdown() error {
break
}

if w.lastSuccessfulStatusTime().Sub(waitStatusStart) > 0 {
if w.lastSuccessfulStatusTime().After(waitStatusStart) {
break
}

Expand Down

0 comments on commit a8cc893

Please sign in to comment.