Skip to content

Give every unit test its own local sandbox root - #142

Merged
earakely-scale merged 1 commit into
mainfrom
edgararakelyan/unit-tests-own-sandbox-root
Oct 9, 2026
Merged

earakely-scale merged 1 commit into
mainfrom
edgararakelyan/unit-tests-own-sandbox-root

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Four unit test files create real local sandboxes (local_sandbox_host_ports_test, local_sandbox_test and the two network_policy_* tests). They create them in the default root, ~/.agent-env-sandboxes, and nothing removes them. So each run of the unit suite left about ten work dirs in the developer's home. One machine had collected about 20,000, roughly 700 a day, which every local sandbox lookup then scans.

The autouse isolated_state_root fixture already gives each unit test its own XDG_STATE_HOME. It now sets AGENT_ENV_LOCAL_SANDBOX_DIR to a temp dir as well. Tests that set their own root still do. The integration tiers are unchanged: on macOS, Docker can only bind-mount compose files from a shared path, which is why the default root is in the home dir.

Before / after: a full unit run added 10 work dirs to ~/.agent-env-sandboxes, and now adds 0. All 7,087 unit tests pass.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Gives each unit test its own temporary local sandbox root through isolated_state_root.

  • Each unit test keeps local sandbox work in a temporary folder.

No actionable issues were found. Tests were not run during this review.

Reviews (1) · Last reviewed commit: "Give every unit test its own local sandb..." · Reviewed by Greptile

Four unit test files create real local sandboxes, in the default root under the user's home, and
nothing removes them: each run of the suite left about ten work dirs in ~/.agent-env-sandboxes.
The autouse fixture that already gives each test its own state root now gives it its own sandbox
root too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@earakely-scale
earakely-scale requested a review from a team as a code owner October 9, 2026 17:44
@earakely-scale
earakely-scale merged commit c70a09b into main Oct 9, 2026
13 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/unit-tests-own-sandbox-root branch October 9, 2026 18:03
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.

1 participant