Skip to content

Commit 7c09465

Browse files
refactor: CR's fixes
1 parent ab5acfb commit 7c09465

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

enterprise/coderd/prebuilds/reconcile_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,15 +748,19 @@ func TestSkippingHardLimitedPresets(t *testing.T) {
748748
// Verify the final state after reconciliation.
749749
workspaces, err = db.GetWorkspacesByTemplateID(ctx, template.ID)
750750
require.NoError(t, err)
751+
updatedPreset, err := db.GetPresetByID(ctx, preset.ID)
752+
require.NoError(t, err)
751753

752754
if !tc.isHardLimitHit {
753755
// When hard limit is not reached, a new workspace should be created.
754756
require.Equal(t, 2, len(workspaces))
757+
require.Equal(t, database.PrebuildStatusHealthy, updatedPreset.PrebuildStatus)
755758
return
756759
}
757760

758761
// When hard limit is reached, no new workspace should be created.
759762
require.Equal(t, 1, len(workspaces))
763+
require.Equal(t, database.PrebuildStatusHardLimited, updatedPreset.PrebuildStatus)
760764

761765
// When hard limit is reached, a notification should be sent.
762766
matching := fakeEnqueuer.Sent(func(notification *notificationstest.FakeNotification) bool {

0 commit comments

Comments
 (0)