@@ -503,6 +503,7 @@ func mustTransitionWorkspace(t *testing.T, client *codersdk.Client, workspaceID
503
503
}
504
504
505
505
func mustWorkspace (t * testing.T , client * codersdk.Client , workspaceID uuid.UUID ) codersdk.Workspace {
506
+ t .Helper ()
506
507
ctx := context .Background ()
507
508
ws , err := client .Workspace (ctx , workspaceID )
508
509
if err != nil && strings .Contains (err .Error (), "status code 410" ) {
@@ -513,6 +514,7 @@ func mustWorkspace(t *testing.T, client *codersdk.Client, workspaceID uuid.UUID)
513
514
}
514
515
515
516
func assertLatestTransitionWithEventualBuild (t * testing.T , client * codersdk.Client , workspace codersdk.Workspace , expected codersdk.WorkspaceTransition ) {
517
+ t .Helper ()
516
518
assert .Eventually (t , func () bool {
517
519
ws := mustWorkspace (t , client , workspace .ID )
518
520
if ws .LatestBuild .ID == workspace .LatestBuild .ID {
@@ -523,10 +525,11 @@ func assertLatestTransitionWithEventualBuild(t *testing.T, client *codersdk.Clie
523
525
}
524
526
// At this point a build has happened. Is it what we want?
525
527
return assert .Equal (t , expected , ws .LatestBuild .Transition )
526
- }, 5 * time .Second , 25 * time .Millisecond )
528
+ }, 3 * time .Second , 25 * time .Millisecond )
527
529
}
528
530
529
531
func assertLatestTransitionWithNoEventualBuild (t * testing.T , client * codersdk.Client , workspace codersdk.Workspace , expected codersdk.WorkspaceTransition ) {
532
+ t .Helper ()
530
533
assert .Never (t , func () bool {
531
534
ws := mustWorkspace (t , client , workspace .ID )
532
535
if ws .LatestBuild .ID == workspace .LatestBuild .ID {
@@ -537,7 +540,7 @@ func assertLatestTransitionWithNoEventualBuild(t *testing.T, client *codersdk.Cl
537
540
}
538
541
// At this point a build should not have happened. Is the state still as expected?
539
542
return assert .Equal (t , expected , ws .LatestBuild .Transition )
540
- }, 5 * time .Second , 25 * time .Millisecond )
543
+ }, 3 * time .Second , 25 * time .Millisecond )
541
544
}
542
545
543
546
func TestMain (m * testing.M ) {
0 commit comments