Skip to content

Commit

Permalink
Fix tests with mock clock
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinmclean committed Dec 29, 2024
1 parent b595ac8 commit 9e91f1a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion garden-app/worker/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,9 @@ func TestScheduleLightActions(t *testing.T) {
}

func TestScheduleLightDelay(t *testing.T) {
_ = clock.MockTime()
defer t.Cleanup(clock.Reset)

tests := []struct {
name string
garden *pkg.Garden
Expand Down Expand Up @@ -894,7 +897,7 @@ func TestScheduleLightDelay(t *testing.T) {
tt.garden.LightSchedule.StartTime.Time.Minute(),
tt.garden.LightSchedule.StartTime.Time.Second(),
0,
time.Local,
now.Location(),
).Add(tt.expectedDelay).Truncate(time.Second)
}

Expand Down

0 comments on commit 9e91f1a

Please sign in to comment.