Repository navigation
fix(tests): wait for shell-agent fixture pids without inotify - #1885
Conversation
Three server/shell-agent.test.ts tests failed together in check fast with "EMFILE: too many open files, watch": they waited for a fixture shell's pid file with fs.watch, and each watching process needs an inotify instance, which every process of the user shares (128 by default; 119 to 125 in use on the maintainer's PC running many agents). The three waits now read a FIFO that the shell writes its pid into, made before the shell starts and bounded (the bound opens the write end itself, so the pending read ends); the reads after the probe answered read the file directly. With every fs.watch refused (an injected EMFILE, and the PC's own limit at the time), main fails exactly those three tests and this passes all 18. Fixes #1882
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 4 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
CodeRabbit's review was rate-limited ("Review limit reached"), so no CodeRabbit review ran on this PR. The review below stands in for it. omo-native-code-reviewer: APPROVE, no blockers. It checked deadlock freedom (each FIFO and its read exist before the shell starts), the bound (a reader blocked in |
|
Merge pass review-work report. Overall: PASSED. This PR changes a test only. Under the maintainer's token rule it merges on the code review, the merge pass's own check and CI, without the gate reviewer. It is first in the queue because it unblocks every lane's local
What was checked
Follow-ups (LOW)
All required checks are green, and no review thread is open. CodeRabbit did not review this PR (rate-limited or skipped). The reviews above stand in for it. |
Fixes #1882.
What failed
Three
server/shell-agent.test.tstests failed together inbun run check faston the maintainer's PC withEMFILE: too many open files, watch '<tmp>/ovis-shell-agent-path-*/home': "hung or oversized login probe is killed and reaped…", "answers a shell SIGKILL does not end within the bound…" and "stop cancels refresh without leaking a child".Root cause
They waited for a fixture shell's pid file with
fs.watchon its directory. Every watching process needs an inotify instance, andfs.inotify.max_user_instances(128 by default) is shared by every process of the user: with many agent sessions and their watchers, 119 to 126 of 128 were in use on that PC, and the watch was refused. Before #1864 the same refusal left a pid of 0, and the test'skill(0)ended the whole unit step with no failure reported.Fix (test only)
Proof
fs.watchrefused (an injected EMFILE, and the PC's own exhausted limit at the time), main fails exactly those three tests withEMFILE; this passes all 18.bun run check fast: passed (6396 pass, 0 fail) while the PC was at 126/128 inotify instances.Part of the flaky-tests lane.