Skip to content

test(ui-sdk): walk worker filesystems by dirent type and in parallel - #2675

Merged
schlessera merged 1 commit into
mainfrom
fix/main-red-086-044
Oct 23, 2026
Merged

schlessera merged 1 commit into
mainfrom
fix/main-red-086-044

Conversation

@schlessera

@schlessera schlessera commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Closes #2674

What changed

packages/ui-sdk/tests/worker-var-sockets.test.ts failed 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 called lstat on every non-directory entry. The walk now takes each entry's type from readdir and 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 /proc and /sys exclusions, 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) and 086db5b2: 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 on 4ba50d82 (unit 4). On 086db5b2, 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. Native find -type s was 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 admission are planned nested failures inside tests/unit-workers.test.ts, and its parent test passed. Inference egress limit exceeded is printed by passing tests in packages/ui-sdk/tests/inference-egress.test.ts.

Proof

Head c320a9f30, base origin/main 086db5b20.

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/main fixture: (fail) all worker profiles hide every /var socket while explicit runtime files still execute [180023.62ms] / ^ this test timed out after 180000ms.
  • This change: 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:

  • Walk drops sockets (sockets.push(child) → void 0): fails on governed: SOCKET_WALK_ONLY_APPROVED_RELAY_AND_PROXY (expected the relay and proxy sockets, received []).
  • Every entry forced through the untyped lstat fallback (if(true||…)): passes (1 pass, 8.6 s), so the fallback finds exactly the approved sockets.
bun run check:pr --base origin/main

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

  • Focused local preflight/behavioral receipts and complete selected hosted proof passed; actual head/base/job checkout evidence is in Proof.
  • Acceptance criteria from the issue are all met, or the gap is named below.
  • The PR and completed/advanced issues have verified release milestones under docs/process/github.md.
  • A changeset is included, or this changes nothing a consumer can see. (Test fixture only.)
  • No personal data anywhere in the diff — the leakage gate covers the whole tree.
  • The integration contract index or relevant component is updated in this same commit, or nothing in the machine surface moved.
  • Docs under docs/ reflect the change, or nothing documented moved.
  • Provider history stays append-only (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

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]>
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.

ui-sdk: the /var socket test walks the whole filesystem three times in series and times out on loaded CI shards

1 participant