Repository navigation
test: have the local stack remove only the sandboxes its own process made - #584
Merged
Merged
Conversation
…made local_stack_at's teardown force-removed every container named agent-env-local-*, which is every local sandbox's compose containers on this machine's Docker. Run two tests at a time and it removed the other worker's gateway mid-deploy (PR #582: multi_env_computers_test's three tests, 'Gateway container not running'). It now records the ids of the LocalSandboxes made while the stack is up and removes only theirs. Co-Authored-By: Claude <[email protected]>
earakely-scale
approved these changes
Nov 10, 2026
andrewpark-scaleai
deleted the
andrew-park/ci-slow-tier-own-sandboxes
branch
November 10, 2026 00:38
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.
Why
The goal is a slow tier that can run two tests at a time on each runner, which is the most promising remaining speedup on the same 12 runners. Draft #582 tried
-n 2once. Its only failures were threemulti_env_computers_test.pytests on shard 3, which failed withGateway container not running. When the test failed,docker psshowed no gateway at all.The other worker on that shard had just finished
local_parallel_deploy_test.py. Itslocal_stack_atteardown, which eight other test files share, force-removes every container namedagent-env-local-*. Every local sandbox's compose project is named after its work dir,agent-env-<sandbox id>-…, so the teardown removed the other worker's gateway as it deployed.What changes
While the stack is up,
local_stack_atrecords the id of eachLocalSandboxits own process makes. At teardown it removes only the containers named for those ids. Pytest workers are separate processes, so another worker's sandboxes are never recorded.Verification
agent-env-local-0therw0r-abc-gateway-1, and one named for a sandbox made inside the stack, the teardown removed the stack's container and kept the other one.ruff checkpasses.I'll rerun #582 with this change to check whether any other test collides.


Confidence Score: 5/5
This PR appears safe to merge.Summary
local_stack_atnow records sandbox IDs in the test process and removes only matching Compose containers at teardown.Reviews (1) · Last reviewed commit: "test: have the local stack remove only t..." · Reviewed by Greptile