Skip to content

test: avoid Node shutdown deadlock in ownership fixture - #2078

Merged
wjarka merged 1 commit into
mainfrom
cez/049c0db8
Oct 28, 2026
Merged

wjarka merged 1 commit into
mainfrom
cez/049c0db8

Conversation

@wjarka

@wjarka wjarka commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #2048
Closes #2047

Summary

Run the ownership fixture's child Node processes with --single-threaded. Node 24.21.0 can deadlock inside process.exit() while joining V8 background workers that need a main-thread GC. The duplicate cockpit then prints its refusal but never exits, failing main CI despite correct ownership behavior.

This avoids the upstream runtime defect only in the fixture. Production flags and exit behavior, test assertions and timeouts stay unchanged. The fixture still starts real cockpit processes and checks refusal, aliases, independent repositories, dead-owner recovery and competing restarts.

Evidence

Source CI: run 40713039005 attempt 1, job 122904314069 step 14, commit 28c01509d2f45c474b0593372e36638071399b25. The refusal prints before the original duplicate assertion at line 65 times out. The aggregate job starts after cancellation and is a consequence, not another defect.

Upstream: nodejs/node#64274 and proposed fix nodejs/node#66171 (still open). The upstream report includes this runtime and failure shape. The original CI process has no native stack, so attribution is supported by the controlled reproduction rather than a recovered CI backtrace.

proof_base=19284ba7bbd729bc398a78ab89019c517a9ca437. In a disposable checkout with its own dependencies, concurrent allocation pressure plus a bounded threadpool job at process.exit(1) makes the existing fixture fail at the same duplicate check: 1 failed / 1 total, refusal printed, exit entered, no exit observed for the unchanged bound. With --single-threaded the same pressured fixture passes 1/1. The direct refusal probe also hangs 3/3 without the flag and exits 3/3 with it. Full reproduction script and results are recorded in the repair summary's comments.

Design decision

Direct track under the user's instruction to proceed autonomously. This is a bounded test-runtime workaround in one fixture, with no dependency or public behavior change. The load-bearing guarantees are the existing refusal/exit-code assertions and recovery checks; all remain unchanged. V8 background compilation is outside the ownership mechanism being tested. The guard is not extended and no failure is retried or ignored.

Experience

N/A — no UI change.

Verification

  • npm run build → passed; check:pack: 1204 files, 97 cockpit assets.
  • Node 24.21.0 normal final built ownership fixture → 1 passed / 1 total.
  • Disposable allocation-pressure proof → old fixture 1 failed / 1 total; fixed fixture 1 passed / 1 total. Ten earlier normal ownership passes were inconclusive; these controlled red/green results establish the workaround.
  • Code-quality check on final 76d01ff04: PASS, 1/1 changed functions; start: complexity 1, body line coverage 100%, CRAP 1. Collected native Node V8 coverage with its built-in whitespace-preserving type stripping, converted with installed ast-v8-to-istanbul, then passed --coverage to the repository checker. Its built-in Node collector rejects TypeScript; no missing coverage was treated as a pass.
  • Citation check and git diff --check → passed.
  • No production TypeScript changed. CI owns the full verification gate; no local full-suite pass is claimed.

Report resolution

Report Cause Resolution
#2047 Ownership fixture enters the upstream Node shutdown deadlock Avoid the runtime condition in its child processes; closing reference above; keep open until merge
#2048 Summary of that single diagnostic report Covered by this combined repair; closing reference above; keep open until merge

Left undone

The upstream Node runtime fix remains external. This PR does not change production runtime threading or claim to repair Node itself. The unrelated environment-sensitive packaged tool-list test remains tracked in #1505.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found

@github-actions
github-actions Bot marked this pull request as ready for review October 28, 2026 20:23
@github-actions

Copy link
Copy Markdown

npm preview published — 0.17.0-pr2078.3189

npx cezarion@0.17.0-pr2078.3189

Moving tag: cezarion@pr-2078

@wjarka

wjarka commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator Author

The combined repair is verified and ready for human review in #2078.

At head 76d01ff04340fc5b4ba80575e42b6537c52e4d0f, CI run 40759620474 passed all three Vitest shards, all four cockpit browser shards, typecheck, unit/build/package and the required verification aggregate. Automated Code Review passed with “No issues found”; there are no review threads. The PR is MERGEABLE/CLEAN. GitHub's readiness workflow marked it ready; this task did not undraft or merge it.

The repair adds --single-threaded only to ownership fixture child Node processes to avoid the upstream Node shutdown deadlock. The controlled allocation-pressure regression fails without the flag and passes with it. Production flags, assertions and test bounds remain unchanged. The complete proof is in #2048 (comment).

Report Cause Fixing evidence Final action
#2047 Node shutdown deadlock interrupts the ownership fixture Red/green reproduction, commit 76d01ff04, passing exact-head CI Remains OPEN; verified closing reference in PR #2078; human review/merge owns closure
#2048 Summary of that sole member Same combined repair and passing verification Remains OPEN; verified closing reference in PR #2078; human review/merge owns closure

No other occurrence was saved on the diagnostic report at the final review. No unresolved member is being closed. Both reports remain open until the repair merges. No merge or CI rerun was performed by this task. The investigation claim is released at handoff; PR review and merge remain with the owner.

@wjarka
wjarka merged commit 5f216f9 into main Oct 28, 2026
30 checks passed
@wjarka
wjarka deleted the cez/049c0db8 branch October 28, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task]: Repair main CI run 40713039005 attempt 1 [Task]: Investigate verification failure

1 participant