Repository navigation
test: pay the Pi fixtures' first exec before timing them - #16028
Conversation
The dispatch test's timeout-serialization check failed three times on the fleet (runs 36477723258, 36632828304 and validation run 36713362165) with ['start second', 'end second']: the extension's 1000 ms hook timer sent SIGTERM to the first fake cmux before it ran a line, because macOS held the freshly written script's first exec while syspolicyd assessed it. Measured here, a fresh script's first exec takes about 200 ms and a second about 5-20 ms, and concurrent first execs queue about 185 ms apart, so a few fresh executables anywhere on a loaded mini push one past 1 s. The install test's "generated Pi extension is not importable" failure (run 36632828304, stderr "timed out waiting for hooks pi prompt-submit") is the same class: the fake cmux's first exec lands inside a 5 s wait. Every fixture now exits at once when CMUX_TEST_PRIME_EXEC is set and is run that way as soon as it is written, as #15768 and #15955 did for the Hermes and Claude wrapper fixtures. No timeout, budget or assertion changes. Refs #15488 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
All contributors have signed the CLA ✍️ ✅ |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe dispatch and install test modules now prime generated executable fixtures. Each fixture includes a language-specific early-exit guard and runs with a priming environment variable, suppressed standard streams, and a 120-second timeout. ChangesExecutable Fixture Priming
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Other Merge Risk: ⚪ Minimal · up to The change primes generated fixtures while preserving their ordinary test behavior. No merge-blocking risk is established. 🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
|
Merge receipt for |
e709b69 fix(cloud): stop reconciling panes a Cloud workspace already shows (manaflow-ai#16025) d13dde3 Diff viewer: viewed state, file filter, generated and large diffs collapsed (manaflow-ai#15536) e0d5c5e test: pay the Pi fixtures' first exec before timing them (manaflow-ai#16028) e2e0b61 ci: disable unstable UI test dispatch lane (manaflow-ai#16075) 15996b0 ci: sweep side lanes instead of rescuing workflow runs (manaflow-ai#16076) 3dcf462 Recover terminal chat when transcript files are replaced (manaflow-ai#16045) 272d069 fix(agent-chat): let Stop cancel a queued or starting ACP turn (manaflow-ai#15925) 30bd116 test: cover invalid unquoted Xcode extension paths (manaflow-ai#16054) a24a1b5 Make GitHub references in the agent chat transcript clickable (manaflow-ai#15916) 86d1cfc Reap failed Codex app-server startups before retrying (manaflow-ai#15977) 890cd1e fix(sidebar): expose workspace close button to accessibility (manaflow-ai#15965) faf4c8f docs: define agent fan-out and reusable Cloud work environments (manaflow-ai#15836) ab20b79 ci: cut cmux-tui Testbox warmup hold time (manaflow-ai#15557) 31fb228 Promote devbox images with cmux-tui 7d17754 (VT replay blank-cell fix) (manaflow-ai#16072) e0da0a6 feat(acp): cmux as a read-only ACP host, phase 1 (manaflow-ai#15976) 3ed1d77 Reap failed ACP startups and temporary catalog probes (manaflow-ai#15979) f5c3567 Add a Focus TextBox Input item to the View menu (manaflow-ai#15730) b3a1ca1 Document the 32 CLI verbs the contract table was missing, and guard it (manaflow-ai#15993) 3bba04e Say which app-host result file could not be read (manaflow-ai#15997) 7ef6d3a Resume Cloud Codex chats after app-server restart (manaflow-ai#15915) a803f36 fix: surface simulator process output reader failures (manaflow-ai#15880) f6a0163 Keep terminal approval notices from moving the composer (manaflow-ai#15886) b8ab767 test: isolate feature flag defaults between runs (manaflow-ai#15587) 5150a9b Keep unsent cloud prompts recoverable (manaflow-ai#15902) 233bd6d Restore terminal attention when transcript chat reconnects (manaflow-ai#15891) 573f998 Resolve a dogfood menu path against the direct children of each open menu (manaflow-ai#15923) 7b7a1b2 test(ci): assert the registry guard's exit code, and handle merge_group (manaflow-ai#16017) # Conflicts: # .github/workflows/ci-guards.yml # .github/workflows/ci-owned-pool-rescue.yml # .github/workflows/ci-ui-tests.yml # .github/workflows/ci.yml # .github/workflows/cmux-tui-testbox-warmup.yml
The Pi extension tests no longer lose a race with macOS's first-run check.
tests/test_pi_extension_dispatch.pyfailed three times on fleet minis withFAIL: timeout harness missed a serialized command: ['start second', 'end second'], andtests/test_pi_extension_install.pyonce withgenerated Pi extension is not importable. In each case a freshly written fixture's first exec was held past the extension's timer. Each fixture now pays that check before any timed run. This is the Pi part of #15488.Cause
macOS holds the first exec of every newly written file while syspolicyd assesses it. On this Mac a fresh script's first exec takes about 200 ms, and later ones take 5–20 ms. First execs happening at the same time queue about 185 ms apart, so a few fresh executables anywhere on a loaded mini push one past a second.
check_timeout_serialization: the extension times each child fromspawnand sends SIGTERM atCMUX_PI_HOOK_TIMEOUT_MS=1000. The faketimeout-cmuxlogsstartbefore it installs its SIGTERM handler. A log of['start second', 'end second']with nooverlap secondtherefore means the first child was killed by SIGTERM's default action before its first line ran.timed out waiting for hooks pi prompt-submit, a 5 s wait. The fresh fakecmuxruns for the first time inside that wait.Failures on the fleet:
Change
make_executablein both files adds a guard right after the shebang, in bash, node or Python form, so the fixture exits at once whenCMUX_TEST_PRIME_EXECis set. It then runs the fixture once that way, with onlyPATHand that key set. This is the pattern #15768 and #15955 use. No timeout, budget or assertion changes.Verification
The dispatch checks ran under bun on this Mac, against the extension source assembled from the
CLI/strings; nothing was built.An artificial first-exec delay of 5.5 s reproduces the install test's exact error, and the fixed file passes under the same delay. The whole install file needs a built CLI, so it wasn't run here.
Coverage. Both files run only in the macOS
CLI product testslane, which this PR skips because it changes only Python tests. The #15488 full-suite validation ran them with this change on cmuxs-mac-mini-5, where both had failed in run 36632828304:tests/test_pi_extension_install.py ok in 22.4sandtests/test_pi_extension_dispatch.py ok in 30.7s, with all 84 lane tests passing (job).Changelog
🤖 Generated with Claude Code