Skip to content

Commit 05e4c5e

Browse files
committed
no asserts in eventually/never
1 parent b0260d7 commit 05e4c5e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

coderd/autobuild/executor/lifecycle_executor_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ func mustWorkspace(t *testing.T, client *codersdk.Client, workspaceID uuid.UUID)
515515

516516
func assertLatestTransitionWithEventualBuild(t *testing.T, client *codersdk.Client, workspace codersdk.Workspace, expected codersdk.WorkspaceTransition) {
517517
t.Helper()
518+
// assert.Eventually appears to have concurrency issues
518519
assert.Eventually(t, func() bool {
519520
ws := mustWorkspace(t, client, workspace.ID)
520521
if ws.LatestBuild.ID == workspace.LatestBuild.ID {
@@ -524,7 +525,8 @@ func assertLatestTransitionWithEventualBuild(t *testing.T, client *codersdk.Clie
524525
return false
525526
}
526527
// At this point a build has happened. Is it what we want?
527-
return assert.Equal(t, expected, ws.LatestBuild.Transition)
528+
// return assert.Equal(t, expected, ws.LatestBuild.Transition)
529+
return expected == ws.LatestBuild.Transition
528530
}, 3*time.Second, 25*time.Millisecond)
529531
}
530532

@@ -539,7 +541,8 @@ func assertLatestTransitionWithNoEventualBuild(t *testing.T, client *codersdk.Cl
539541
return false
540542
}
541543
// At this point a build should not have happened. Is the state still as expected?
542-
return assert.Equal(t, expected, ws.LatestBuild.Transition)
544+
// return assert.Equal(t, expected, ws.LatestBuild.Transition)
545+
return expected == ws.LatestBuild.Transition
543546
}, 3*time.Second, 25*time.Millisecond)
544547
}
545548

0 commit comments

Comments
 (0)