@@ -515,6 +515,7 @@ func mustWorkspace(t *testing.T, client *codersdk.Client, workspaceID uuid.UUID)
515
515
516
516
func assertLatestTransitionWithEventualBuild (t * testing.T , client * codersdk.Client , workspace codersdk.Workspace , expected codersdk.WorkspaceTransition ) {
517
517
t .Helper ()
518
+ // assert.Eventually appears to have concurrency issues
518
519
assert .Eventually (t , func () bool {
519
520
ws := mustWorkspace (t , client , workspace .ID )
520
521
if ws .LatestBuild .ID == workspace .LatestBuild .ID {
@@ -524,7 +525,8 @@ func assertLatestTransitionWithEventualBuild(t *testing.T, client *codersdk.Clie
524
525
return false
525
526
}
526
527
// 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
528
530
}, 3 * time .Second , 25 * time .Millisecond )
529
531
}
530
532
@@ -539,7 +541,8 @@ func assertLatestTransitionWithNoEventualBuild(t *testing.T, client *codersdk.Cl
539
541
return false
540
542
}
541
543
// 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
543
546
}, 3 * time .Second , 25 * time .Millisecond )
544
547
}
545
548
0 commit comments