Fix the staged-enrollment suite: ps state flags broke the stopped-child probe - #831
Fix the staged-enrollment suite: ps state flags broke the stopped-child probe#831Aurora Capital (auroracapital) wants to merge 1 commit into
Conversation
…Linux test-staged-enrollment.sh has been failing on main with "timed out waiting for replacement-lock fault stop". The fault injection was fine; the probe that watches for it was wrong. childProcessState compared the whole `ps -o state=` field to 'T'. BSD ps appends flag characters to that field: `+` foreground process group, `s` session leader, `N` reduced priority, `<` raised priority. A stopped child on macOS reads `TN` or `T+`, so the equality could never hold and every waitForStoppedChild call burned its full 5s timeout before asserting. Linux ps reports a bare `T`, which is why CI stayed green and only local runs failed. Measured on this machine rather than inferred: a spawned child reports "SN" while running and "TN" after SIGSTOP, so `=== 'T'` is false and `charAt(0)` is 'T'. The fix takes the leading state letter and drops the flags. One helper, so all four waitForStoppedChild call sites are covered. Line 608 was simply the first to run, which is why only it appeared in the failure output. Verified: test-staged-enrollment.sh now exits 0 both on this branch off main and on the CRS-removal branch, taking the repo from 27/28 suites to 28/28. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan includes up to 2 reviews per rolling hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe ChangesProcess-state detection
Merge Risk: ⚪ Minimal · up to This localized test fix corrects stopped-child detection for platform-specific process-state flags; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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 |
test-staged-enrollment.shhas been red onmain, failing withtimed out waiting for replacement-lock fault stop. The fault injection ittests was working fine. The probe watching for it was wrong.
Cause
childProcessStatecompared the entireps -o state=field to'T':BSD
psappends flag characters to the state field:+foreground processgroup,
ssession leader,Nreduced priority,<raised priority. A stoppedchild on macOS reads
TNorT+, never a bareT, so the equality could neverhold and every
waitForStoppedChildcall burned its full 5s timeout beforeasserting.
Linux
psreports a bareT. That is why CI stayed green while local runsfailed, and why the bug survived.
Measured, not assumed
Spawning a child and stopping it on this machine:
Fix
Take the leading state letter and drop the flags. One helper, so all four
waitForStoppedChildcall sites are covered — line 608 was simply the first torun, which is why only it appeared in the failure output.
Verification
test-staged-enrollment.shexits 0 on this branch offmain, and also on theCRS-removal branch (#830). That takes the repo from 27/28 suites to 28/28.
Worth noting why this matters beyond one suite: a suite that fails permanently
teaches everyone to skim past failures, which is how the
rm -rfguard defectin #826 sat unnoticed inside the other red suite.
🤖 Generated with Claude Code
Summary by CodeRabbit