Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita68122c

Browse files
authored
chore: fix Test_Runner/CleanupPendingBuild with testutil.Eventually (#19924)
Fixescoder/internal#968
1 parentf80cc15 commita68122c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

‎scaletest/createworkspaces/run_test.go‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ func Test_Runner(t *testing.T) {
264264
// Wait for the workspace build job to be picked up.
265265
checkJobStartedCtx:=testutil.Context(t,testutil.WaitLong)
266266
jobCh:=make(chan codersdk.ProvisionerJob,1)
267-
require.Eventually(t,func()bool {
267+
testutil.Eventually(checkJobStartedCtx,t,func(ctx context.Context)bool {
268268
workspaces,err:=client.Workspaces(checkJobStartedCtx, codersdk.WorkspaceFilter{})
269269
iferr!=nil {
270270
returnfalse
@@ -286,7 +286,7 @@ func Test_Runner(t *testing.T) {
286286
}
287287
jobCh<-ws.LatestBuild.Job
288288
returntrue
289-
},testutil.WaitLong,testutil.IntervalSlow)
289+
},testutil.IntervalSlow)
290290

291291
t.Log("canceling scaletest workspace creation")
292292
runnerCancel()
@@ -308,9 +308,8 @@ func Test_Runner(t *testing.T) {
308308
}()
309309

310310
// Ensure the job has been marked as canceled
311-
checkJobCanceledCtx:=testutil.Context(t,testutil.WaitLong)
312-
require.Eventually(t,func()bool {
313-
pj,err:=client.OrganizationProvisionerJob(checkJobCanceledCtx,runningJob.OrganizationID,runningJob.ID)
311+
testutil.Eventually(cleanupCtx,t,func(ctx context.Context)bool {
312+
pj,err:=client.OrganizationProvisionerJob(ctx,runningJob.OrganizationID,runningJob.ID)
314313
if!assert.NoError(t,err) {
315314
returnfalse
316315
}
@@ -324,7 +323,7 @@ func Test_Runner(t *testing.T) {
324323
}
325324

326325
returntrue
327-
},testutil.WaitLong,testutil.IntervalSlow)
326+
},testutil.IntervalSlow)
328327
cleanupCancel()
329328
<-done
330329
cleanupLogsStr:=cleanupLogs.String()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp