Skip to content

Commit 431cece

Browse files
committed
Fix tests
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
1 parent 5d2fea5 commit 431cece

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

enterprise/coderd/prebuilds/claim_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func TestClaimPrebuild(t *testing.T) {
104104
ctx = dbauthz.AsSystemRestricted(ctx)
105105

106106
// Given: a reconciliation completes.
107-
controller.Reconcile(ctx, nil)
107+
require.NoError(t, controller.ReconcileAll(ctx))
108108

109109
// Given: a set of running, eligible prebuilds eventually starts up.
110110
runningPrebuilds := make(map[uuid.UUID]database.GetRunningPrebuildsRow, desiredInstances*presetCount)

enterprise/coderd/prebuilds/controller_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func TestNoReconciliationActionsIfNoPresets(t *testing.T) {
5353
require.Equal(t, templateVersion, gotTemplateVersion)
5454

5555
// when we trigger the reconciliation loop for all templates
56-
controller.Reconcile(ctx, nil)
56+
require.NoError(t, controller.ReconcileAll(ctx))
5757

5858
// then no reconciliation actions are taken
5959
// because without presets, there are no prebuilds
@@ -109,7 +109,7 @@ func TestNoReconciliationActionsIfNoPrebuilds(t *testing.T) {
109109
require.NotEmpty(t, presetParameters)
110110

111111
// when we trigger the reconciliation loop for all templates
112-
controller.Reconcile(ctx, nil)
112+
require.NoError(t, controller.ReconcileAll(ctx))
113113

114114
// then no reconciliation actions are taken
115115
// because without prebuilds, there is nothing to reconcile
@@ -316,7 +316,7 @@ func TestActiveTemplateVersionPrebuilds(t *testing.T) {
316316
templateID,
317317
)
318318

319-
controller.Reconcile(ctx, nil)
319+
require.NoError(t, controller.ReconcileAll(ctx))
320320

321321
createdNewPrebuild := false
322322
deletedOldPrebuild := true
@@ -365,7 +365,7 @@ func TestInactiveTemplateVersionPrebuilds(t *testing.T) {
365365
// * a third is not running because its latest build was a start transition but the build failed
366366
// * a fourth is not running because its latest build was a start transition but the build was canceled
367367
// when we trigger the reconciliation loop for all templates
368-
controller.Reconcile(ctx, nil)
368+
require.NoError(t, controller.ReconcileAll(ctx))
369369
// then the four non running prebuilds are deleted
370370
// and 1 of the running prebuilds is deleted
371371
// because stopped, deleted and failed builds are not considered running in terms of the definition of "running" above.

0 commit comments

Comments
 (0)