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

Commite7c3b85

Browse files
committed
test: fix flake in scaletest/workspaceupdates/TestRun
1 parent6bafbb7 commite7c3b85

File tree

1 file changed

+5
-5
lines changed
  • scaletest/workspacebuild

1 file changed

+5
-5
lines changed

‎scaletest/workspacebuild/run.go‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ func (r *CleanupRunner) Run(ctx context.Context, _ string, logs io.Writer) error
147147
iferr==nil&&build.Job.Status.Active() {
148148
// mark the build as canceled
149149
logger.Info(ctx,"canceling workspace build",slog.F("build_id",build.ID),slog.F("workspace_id",r.workspaceID))
150-
iferr=r.client.CancelWorkspaceBuild(ctx,build.ID, codersdk.CancelWorkspaceBuildParams{});err==nil {
151-
// Wait for the job to cancel before we delete it
152-
_=waitForBuild(ctx,logs,r.client,build.ID)// it will return a "build canceled" error
153-
}else {
154-
logger.Warn(ctx,"failed to cancel workspace build, attempting to delete anyway",slog.Error(err))
150+
iferr=r.client.CancelWorkspaceBuild(ctx,build.ID, codersdk.CancelWorkspaceBuildParams{});err!=nil {
151+
logger.Warn(ctx,"failed to cancel workspace build",slog.Error(err))
155152
}
153+
// Wait for either the build or the cancellation to finish
154+
// either is necessary or we'll fail at the delete step.
155+
_=waitForBuild(ctx,logs,r.client,build.ID)// it will return a "build canceled" error
156156
}else {
157157
logger.Warn(ctx,"unable to lookup latest workspace build, attempting to delete anyway",slog.Error(err))
158158
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp