Skip to content

Commit 7e8b4b6

Browse files
refactor: improve comments for test
1 parent 79725b3 commit 7e8b4b6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

enterprise/coderd/prebuilds/reconcile_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,8 @@ func TestSkippingHardLimitedPresets(t *testing.T) {
688688
clock := quartz.NewMock(t)
689689
ctx := testutil.Context(t, testutil.WaitShort)
690690
cfg := codersdk.PrebuildsConfig{
691-
FailureHardLimit: serpent.Int64(tc.hardLimit),
691+
FailureHardLimit: serpent.Int64(tc.hardLimit),
692+
ReconciliationBackoffInterval: 0,
692693
}
693694
logger := slogtest.Make(
694695
t, &slogtest.Options{IgnoreErrors: true},
@@ -731,8 +732,9 @@ func TestSkippingHardLimitedPresets(t *testing.T) {
731732
workspaceCount := len(workspaces)
732733
require.Equal(t, 1, workspaceCount)
733734

734-
// Advance clock to bypass backoff mechanisms
735-
clock.Advance(time.Second).MustWait(ctx)
735+
// We simulate a failed prebuild in the test; Consequently, the backoff mechanism is triggered when ReconcileAll is called.
736+
// Even though ReconciliationBackoffInterval is set to zero, we still need to advance the clock by at least one nanosecond.
737+
clock.Advance(time.Nanosecond).MustWait(ctx)
736738

737739
// Trigger reconciliation to attempt creating a new prebuild
738740
// The outcome depends on whether the hard limit has been reached

0 commit comments

Comments
 (0)