Repository navigation
v1.93.28.0 fix(flaky): cso-snapshot-state resumes a paused contender only once it has stopped (GSTA-199) - #3716
Merged
Merged
Conversation
…s shows it stopped (GSTA-199) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
resumeStopped checks for an exited child before reading ps and names that exit in its error, separately from the 2 s never-stopped timeout. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The stop check no longer needs a ps binary on Linux. A missing /proc entry (the child was already reaped) loops to the exit check instead of failing. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
gstack: ok 1.93.22.0 for=ship Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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.
What changed
With a 200 ms delay injected between a contender's pause marker and its SIGSTOP, main loses the wakeup in all five paused-contender tests. This branch passes all five.
Before/after as text: With a 200 ms delay injected between a contender's pause marker and its SIGSTOP, main loses the wakeup in all five paused-contender tests; this branch passes all five
Why
Free Tests went red on a correct run in
test/cso-snapshot-state.test.ts, and its retry passed. Now the test resumes a paused child only after it sees the child has stopped, which closes the race behind that red.Blast radius
This changes one test file and adds a changelog fragment. It touches no product code, timing bound or retry.
resumeStoppedruns only inside the five paused-contender tests, and those already return early on Windows. On Linux it reads/proc/<pid>/stat, and on macOS it readsps -o stat=(script ran; CI passed at this head on Linux, macOS and Windows).Approvals
Source: gstack-approvals record for capy/gsta199-cso-sigcont (display only; not an approval citation).
Plan gate: approved with the owner reply "do it" from GStack Minder (autoplan eng-only, fix lane).
Summary
Each paused-contender child writes its pause marker and then sends itself SIGSTOP, as two separate steps. The test used to send SIGCONT as soon as it saw the marker. A SIGCONT that landed between those two steps did nothing, so the child stayed stopped until the test timed out. The new helper
resumeStoppedwaits until the process table shows the child stopped, and only then sends SIGCONT. All 7 resume sites now use it. A child that exits, gets killed, or never stops within 2 s now fails with a named error instead of hanging. This re-ship ran at full review depth, after train build raised the required depth. Review moved the stop check frompsto/proc/<pid>/staton Linux, keptpson macOS, and checks for child exit before reading state.Test Coverage
Regression proof: fails at main · passes after fix. The proof is a scratch copy of the file with a 200 ms delay injected between
mark('paused-'+id)and the SIGSTOP, running the five contender tests selected by name. On origin/main 82db89a it failed 5 of 5 (0 pass). At this branch's fix heads it passed 5 of 5 (QA passes 1–3). The unmodified file passes 88 of 88.Tests ran: typecheck count unavailable
Tests ran: cso-snapshot 88
Tests ran: remote pregate 207 (0 failed, tree a4834df5417c)
Pre-Landing Review
Pre-Landing Review: 4 issues — 3 fixed, 1 noted. All 4 came from the native adversarial pass, whose reviewer rated each one "Severity: Low, Blocks: no". #2 (a clearer exit error) and #3 (check exit before reading state) were fixed in 2f078e0. #1 (the dependency on
ps) was fixed in a9fbd09 under GStack Minder's scoped fix-check grant. #4 (timing) is a note.REVIEW_LOOP: passes=2 blocking_found=3 deferred=0 noted=2 fixed=3 scope=frozen fix_checks=1 dispatches=5 est_input_tokens=18151
REVIEW_DEPTH: full runtime_lines=0 rules=b2272efd321ce7cb reasons=runtime=0,floor:full codes=none
Gate edits: none detected (2 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: openai/gpt-6.1-sol (certified), "I found no issues", Recommendation: approve.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
test/cso-snapshot-state.test.ts:11The 2 s stop budget plus the next 5 s waitForPath can reach Bun's 5 s per-test timeout under CI load, so the failure reads as a plain timeout instead of the named error. Timing bounds are unchanged from base.test/cso-snapshot-state.test.ts:11Linux branch treats only ENOENT as the child being gone; an ESRCH read during exit throws 'stop check failed' instead of looping to the exited error. Only on an already-failing path; changes the message, not the verdict.changelog.d/capy-gsta199-cso-sigcont.mdsays main failed "3 and then 5" of the 5 tests. The 3 came from a run whose name filter selected only four of the five tests. Today's run on main 82db89a failed 5 of 5.Exploratory QA
Pass. Three QA passes reran the file at 88/88 and the injected-delay test at 5/5. The merge base passed 0 of 5 on that same test, as the red control. QA also confirmed that removing the SIGSTOP makes
resumeStoppedfail with its named error.Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Greptile Review
No Greptile comments.
Plan Completion
The plan (autoplan eng-only, fix lane) is complete: 4 items DONE and 1 CHANGED. The CHANGED item is the 2 s stop-check deadline from eng review.
Verification Results
VERIFY_RESULT: pass. At 746e3ab, every PR check is green: 56 pass, 0 fail, 0 pending. That includes Free Tests and Windows Smoke.
TODOS
No TODO items completed in this PR.
Documentation
Status: current — the release changes no user-facing documentation, and no authored doc needed an edit.
Audited scope: base
3bfe5667..HEADa9fbd09concapy/gsta199-cso-sigcont(3 commits), plus the unstaged edit tochangelog.d/capy-gsta199-cso-sigcont.md. Nothing was staged and there were no untracked files. The selected files are one test (test/cso-snapshot-state.test.ts: a newresumeStoppedhelper that sends SIGCONT only once the child shows as stopped, via/proc/<pid>/staton Linux andpson macOS) and its CHANGELOG fragment. I searched every tracked and nonignored file forcso-snapshot-state,SIGCONT,paused contender,resumeStoppedandGSTA-199. Outside the changed files, the only hits are tests,scripts/free-test-durations.jsonand one unrelated released CHANGELOG line, so no authored doc or.tmpldescribes the changed behavior.gstack-banned-terms: none (the repo keeps no list).Documentation health:
Coverage: this release ships no public surface (no command, flag, export, env var or skill), so it adds no coverage debt. Diagram drift: none.
Test plan
bun run typecheck: exit 0bun test test/cso-snapshot-state.test.ts: 88 pass, 0 fail🤖 Generated with Claude Code