Skip to content

fix(scaletest/prebuilds): fix Runner.Cleanup() to delete workspaces#23627

Open
cstyan wants to merge 2 commits intomainfrom
callum/prebuild-scaletest-cleanup
Open

fix(scaletest/prebuilds): fix Runner.Cleanup() to delete workspaces#23627
cstyan wants to merge 2 commits intomainfrom
callum/prebuild-scaletest-cleanup

Conversation

@cstyan
Copy link
Contributor

@cstyan cstyan commented Mar 25, 2026

This PR makes the Cleanup function for prebuild scaletests more reliable. Currently, Cleanup just attempts to delete the prebuilds templates, but templates cannot be deleted if there are any workspaces created from them remaining.

This is problematic because we don't currently generate unique template names on each new prebuilds scaletest run, so this leaves the cluster in a state where another prebuild scaletest cannot be executed without some manual cleanup first.

So, in this PR we're modifying Cleanup to first check for workspaces for the given runners template. It then attempts to delete those workspaces, retrying up to 3x, before finally moving on to the template deletion.

This also means we're properly deleting workspaces for a template if we fail during a call to Run.

Callum Styan and others added 2 commits March 24, 2026 22:55
…efore template

The API rejects template deletion with a 400 while workspaces still exist.
Cleanup() now lists all workspaces for the template, deletes each via
workspacebuild.NewCleanupRunner with up to 3 retries, then deletes the
template. If Run() fails with a 409 conflict (template already exists from a
prior failed run), the existing template is looked up so Cleanup() can remove
it rather than silently skipping it.
… deletion retries

Log every deletion attempt (not just retries) and return an error if
workspaces remain after all attempts, rather than logging an error and
proceeding to template deletion which would fail anyway.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@github-actions
Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


Callum Styan seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@github-actions github-actions bot added the community Pull Requests and issues created by the community. label Mar 25, 2026
@matifali matifali removed the community Pull Requests and issues created by the community. label Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants