fix(runner): tear down resources after a partially-successful setup - #326
Merged
Merged
Conversation
speriaswamy-amd
force-pushed
the
surya/aorta-mn-01-teardown
branch
from
September 8, 2026 15:27
5ce8d1f to
c3cfd3e
Compare
amd-droy
reviewed
Sep 9, 2026
BaseRunner.execute() only set _setup_complete after setup() returned True, so the finally block's teardown() was skipped whenever setup() failed. A multi-node setup that launched containers on nodes 0..N-1 before failing on node N therefore leaked every container it had already created. Set _setup_complete as soon as setup() has been attempted, so teardown() runs for partial setups too. teardown() implementations already tolerate being called with partially-populated state. Adds cvs/runners/unittests/ (the package had no unit tests) with four cases pinning the lifecycle: teardown after success, after setup failure, after run() raises, and not before setup is attempted. Co-Authored-By: Claude <noreply@anthropic.com>
branches: ['*'] does not cross '/' in GitHub Actions glob matching, so pull_request events targeting a namespaced branch (e.g. surya/foo) never triggered this workflow. Use '**' which matches across path segments.
_setup_complete was only set after setup() returned, so an exception raised inside setup() (after it had already created resources) skipped the finally block's teardown call entirely, reintroducing the leak this lifecycle was meant to close. Set the flag in a finally around the setup() call so it always fires.
speriaswamy-amd
force-pushed
the
surya/aorta-mn-01-teardown
branch
from
September 10, 2026 23:13
c3cfd3e to
6c5fae5
Compare
speriaswamy-amd
removed this pull request from stack #333
September 11, 2026 00:23
speriaswamy-amd
added this pull request to stack #414
September 11, 2026 00:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 1/6 — splits #171 into reviewable pieces. Base:
main.Why
BaseRunner.execute()only set_setup_completeaftersetup()returnedTrue, so thefinallyblock'steardown()was skipped whenever setup failed. A multi-node setup that launched containers on nodes 0..N-1 before failing on node N leaked every container it had already created.What changed
cvs/runners/_base_runner.py— set_setup_completeas soon assetup()has been attempted, so teardown runs for partial setups. Existingteardown()implementations already tolerate partially-populated state.cvs/runners/unittests/— new package (cvs/runners/had no unit tests); 4 cases pinning the lifecycle..gitignore— add.venv/.Test
ruff check/ruff format --checkclean. Unit tests 585 → 589.