Repository navigation
test(ui-sdk): walk worker filesystems by dirent type and in parallel - #2675
Merged
Merged
Conversation
The /var socket test walks the whole visible filesystem from each of the governed, strict and maintenance workers. It ran the three walks in series and called lstat on every non-directory entry, so its cost tracked the runner image and shard load: 120 s and 86 s on recent main runs, and past its 180 s timeout on 086db5b next to the browser suites. Take each entry's type from readdir, stat only entries the filesystem left untyped, and run the three independent walks concurrently. The walk root, exclusions, masks, assertions and timeout are unchanged. Closes #2674 Co-Authored-By: Claude Opus 5.5 <[email protected]>
schlessera
marked this pull request as ready for review
October 23, 2026 07:50
This was referenced Oct 23, 2026
Open
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.
Closes #2674
What changed
packages/ui-sdk/tests/worker-var-sockets.test.tsfailed on main (086db5b2, run 39856767038,unit (2)) by timing out at 180 s. Its fixture walks the whole visible filesystem from inside the governed, strict and maintenance workers. The walks ran one after another, and each calledlstaton every non-directory entry. The walk now takes each entry's type fromreaddirand stats only entries the filesystem left untyped (which also walks an untyped directory, where the old walk skipped it). The three independent walks now run concurrently. The walk root, the/procand/sysexclusions, the masks, every assertion and the 180 s timeout are unchanged.Why this shape
The #1665 egress stack (#2399, #2644, #2645) is not the cause. Locally, each walk costs the same on
4ba50d82(last green) and086db5b2: about 7.5 s per profile and about 645,000 entries. All three profiles reach the egress sockets and exit 0 on both commits. On CI the test was already load-bound: it took 120.3 s at its own merge (5b34b6f2, unit 3) and 86.0 s on4ba50d82(unit 4). On086db5b2, changed affected-test selection placed it on unit 2, next to the mounted parallel-session browser suites, and it ran past 180 s. Because it was the same cost on every commit, bisecting the three stack commits would not have isolated a cause. Nativefind -type swas no faster than the walk (5.8 s against 4.6–5.2 s on the same trees), so the walk is bound by I/O and readdir. Narrowing the walk, raising the timeout or skipping the test would each weaken the guard.The other failures in that log are expected output of passing tests.
Odysseus/Penelope owns build, lease and maintenance admissionare planned nested failures insidetests/unit-workers.test.ts, and its parent test passed.Inference egress limit exceededis printed by passing tests inpackages/ui-sdk/tests/inference-egress.test.ts.Proof
Head
c320a9f30, baseorigin/main086db5b20.Failing first, reproducing the CI failure: the test is pinned to one CPU core shared with nine busy loops (
taskset -c 31, same conditions for both runs).origin/mainfixture:(fail) all worker profiles hide every /var socket while explicit runtime files still execute [180023.62ms]/^ this test timed out after 180000ms.1 pass, 31.43 s.Uncontended: 31.3 s → 6.0 s for the whole test (per-profile walk 7.5 s → 4.7 s from the dirent change alone).
Mutations, each restored afterwards:
sockets.push(child)→void 0): fails ongoverned: SOCKET_WALK_ONLY_APPROVED_RELAY_AND_PROXY(expected the relay and proxy sockets, received[]).lstatfallback (if(true||…)): passes (1 pass, 8.6 s), so the fallback finds exactly the approved sockets.Result on
c320a9f30: exit 0,Local preflight passed.(affected suites 235 pass, 0 fail). Its changed-test step selected no tests, because the test loads the fixture by path rather than by import. The focused runs above are the proof for this test.Checklist
docs/reflect the change, or nothing documented moved.docs/decisions/provider-history.md): the provider-history guard passes, or nothing on a turn's path changed.Anything left open
Nothing. Hosted draft checks for this head are still pending.
🤖 Generated with Claude Code