Repository navigation
test: cut the unit tier's slowest waits - #576
Merged
Merged
Conversation
- The launcher validated the host ports only after it had started a guest port's proxy, so a refused launch exited 2 and left that socat running. It now checks every port before it starts any proxy, and the refusal tests assert nothing started. They waited 30s each on the stand-in socat holding stderr. - The optional-extras checks recomputed each extra's dependency closure from installed metadata 39 times a test. The closure is cached, as the installed metadata can't change during a run. - The changelog client's enable baselined the runner's home, /usr/local and /etc with GNU tar. Its roots are now the test's own workspace and CLI state. Co-Authored-By: Claude <noreply@anthropic.com>
earakely-scale
approved these changes
Nov 9, 2026
kaihackney-scale
added a commit
that referenced
this pull request
Nov 10, 2026
Keeps main's cached _closure (#576) alongside this branch's pruned argument. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 faster unit tier that still fails on the changes it exists to catch. The slowest unit tests in run 42679706897 spent their time on three waits that test nothing.
test_changelog.py::test_enable_installs_the_capture_after_both_...and two turn-ordering tests$HOME,/usr/localand/etctest_disk_recipe.py::test_the_launcher_refuses_a_host_port_..., both casessocatthe refused launch left runningtest_optional_extras_stay_optional.py, about 40 casesWhat changes
launchstarted each guest port'ssocatand then checkedVM_HOST_PORTS. A refused launch exited 2 with those proxies still running, because theEXITtrap that stops them is set after the loops. Now both checks run first, then the proxies start. The two refusal tests also assert that nosocatstarted. The 30s was the test's stand-insocatholding stderr open._closureis cached. Each_only_incall parsed every distribution's metadata 39 times. Installed metadata can't change during a run, so_closurenow returns afrozensetunderfunctools.cache._changelog_clientsets the agent's roots to the test's CLI state and workspace. The real defaults are covered bytest_the_default_roots_hold_the_workspace_and_the_clis_state, which this change leaves alone. macOS tar has no--listed-incremental, so the baseline failed at once there, and the tests were only slow on Linux.Verification
Each changed test still fails on the change it guards:
launch(2 failed, after 61s of waiting).PostToolUseFailurefrom_CAPTURE_EVENTSfailstest_enable_installs_the_capture_after_both_....import boto3inagent_env.config.errorsfails 7 of the optional-extras tests.Timings, on a 14-core Mac with
-n 8:test_optional_extras_stay_optional.pytakes 18 to 28s on this branch and 38s on main. That's 94s of CPU against 167s.tst/unit/agents/claude_code/passes: 244 passed, and 30 skipped as Linux-only.The changelog speedup only shows on Linux, so this PR's unit shards are the measurement.
Editing
launchchanges theagentenv-qemu-launcherimage's source tag. The disk images build from the rootfs and disk tools alone, so they keep their tags.

Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
This PR removes repeated work and unnecessary waits from unit tests.
No actionable issues found. Tests were not run during this review.
Reviews (1) · Last reviewed commit: "test: cut the unit tier's slowest waits" · Reviewed by Greptile