Repository navigation
test: land-direct and ubicloud recovery tests pass in one bun process (GST-1613) - #4068
Merged
Merged
Conversation
…res a process (GST-1613) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
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
runMergedChecks moves from the bun test runner into a child Bun, so its prctl flags no longer turn the runner into a non-reaping subreaper.
Before/after as text: runMergedChecks moves from the bun test runner into a child Bun, so its prctl flags no longer turn the runner into a non-reaping subreaper
Why
A free-suite shard that packed
test/ship-queue-land-direct.test.tsandtest/ubicloud-runner-recovery.test.tsinto one bun process hung every recovery run case at the 90 s timeout. The cause islib/land-merged-checks.tscloseLandProc(), which callsprctl(PR_SET_CHILD_SUBREAPER, 1)andPR_SET_DUMPABLE 0on its caller and never undoes them; the land-direct case 'runMergedChecks: HEAD is the merged commit…' reached it in-process, so the bun test runner itself became a subreaper that adopted later orphans and never reaped them. The fake VM's detached phases then stayed zombies thattail --pidandkill -0count as alive. That case now callsrunMergedChecksin a child Bun, so the flags die with the child and the two files pass together again, which unblocks #4063.Blast radius
Only test code changes, in the land-direct test file, the shared fake VM helper, recovery's teardown and a new regression file.
lib/land-merged-checks.tsand its production callers inlib/ship-queue-land-direct.ts(lines 93 and 212) are untouched, and those run inside the short-livedgstack-ship-queue landprocess, which exits after landing (file:line read). The newfakeVm()guard returns false off Linux, so macOS and Windows callers behave as before (file:line read; the Free Tests run at this head passed).Approvals
No approvals recorded for branch capy/gst-1613-land-recovery-isolation.
Summary
The land-direct merged-checks case ran
runMergedChecksinside the bun test runner, and that call permanently turned the runner into a non-dumpable child subreaper. Any later test file in the same process that leaves detached children then leaks zombies. The case now runs the same call in a child Bun withbunIsolationArgs(), the fake VM fails at once with a named error if the runner is already a subreaper, recovery'safterAllfails on any zombie child, and a new regression runs both files in one process.Test Coverage
Step 7 audit: not run (no runtime file changed; the diff is test code only).
Regression proof:
test/land-direct-recovery-isolation.test.tsfails on the old fixture (3.6 s, lane run) and passes on this branch.Tests ran: test 1607 (files, carried from the CI run at this exact tree)
Pre-Landing Review
Pre-Landing Review: 3 issues — 0 auto-fixed, 0 asked (0 fixed, 0 skipped), 0 deferred, 3 noted
REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=3 fixed=0 scope=frozen ledgers_read=1
Gate edits: none detected (9 listed, 2 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 (reasoning medium, certified configuration): no actionable findings; it reran the focused regression and the spawn-timeout guard, 4 passed, 0 failed.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
lib/land-merged-checks.ts:72completeness-gaps:closeLandProc()leaves its caller a non-dumpable child subreaper for the rest of the process. The production caller exits after landing, so nothing breaks today, but a future long-lived in-process caller would inherit the same unreaped-orphan behavior. Unchanged product code, outside this diff.test/helpers/process-reaping.ts:9repo-conventions:isChildSubreaper()dlopenslibc.so.6, so on a non-glibc Linux (musl) everyfakeVm()call would throw. CI and the supported Linux targets are glibc, andlib/land-merged-checks.tsmakes the same dlopen.test/ship-queue-land-direct.test.ts:118timing-dependent-tests (medium confidence): the existing wall-clock bounds in the merged-checks case (under 10 s and under 3 s) now also include one child Bun start per call, about 0.2 to 0.5 s here. The headroom is large and the lane saw 53 pass.Exploratory QA
Not applicable: the diff changes no product code (tests, test helpers and a changelog fragment only), so there is no product surface to probe. The behavior under change is the tests themselves: the lane ran land-direct (53 pass), recovery (29 pass) and the regression (1 pass, and it fails on the old fixture), and the outside reviewer reran the regression.
Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.
TODOS
No TODO items completed in this PR.
Documentation
Status: current. The audit found nothing to edit.
Scope: base 937b360, head abc28bd on
capy/gst-1613-land-recovery-isolation. The diff has 7 files: tests, helpers and achangelog.dfragment, with 0 staged, 0 unstaged and 0 untracked. The 141-doc inventory was searched for references to the changed test helpers andlib/land-merged-checks.ts.Documentation health:
changelog.d/capy-gst-1613-land-recovery-isolation.md: current. Its claims match the diff.docs/TESTING_INTERNALS.md: current. Its fake VM description is unchanged in substance.CONTRIBUTING.md: current. Its test-of-test ratchet description still holds.Coverage debt: none. The change adds no user-facing behavior.
Diagram drift: none found.
Test plan
gstack-pregate --allow-repo-commands: warn (only a MEDIUM pii false positive on a CI run id in the changelog fragment); typecheck, module-size and conflict-marker guards pass; 29 of 29 selected test files reused from the CI runbun run typecheck,bun run typecheck:test, land-direct 53 pass, recovery 29 pass, regression 1 pass, test-of-test / spawnsync-tripwire / module-size / bun-entry-isolation / test-free-shards / state-root ratchets 108 pass🤖 Generated with Claude Code