← Back to Pull requests

[v22.x backport] test_runner: avoid hanging on incomplete v8 frames #65807

Open
unknown opened this pull request with 502 lines diff across 6 files
View on GitHub
unknown unknown commented on Sep 05, 2026 07:24 UTC
Author

Backport #62704 and #64706 together to v22.x-staging to fix test-runner hangs and deserialization errors triggered by binary child stdout.

This follows up on https://github.com/nodejs/node/pull/64706#issuecomment-5452408812.

Why backport to Maintenance LTS

In #62693, child stdout containing FF 0F 7F FF FF FF leaves the parent test runner spinning while draining an incomplete V8 frame. The hang can stall CI even with --test-force-exit; the report also documents that the runner's timeout and SIGTERM cannot recover it. #64061 documents an Appium CI failure in the same deserialization path.

Both fixes have shipped in Current for more than two weeks: #62704 in v26.2.0 (May 20), and #64706 in v26.7.0 (August 5). They are also released in v24.18.0 and v24.20.0 respectively. This backport changes only the deserializer and its existing regression test, with no new public API.

Backport details

  • Apply debe2ed2efd377d301282e4c64489ca2a9d7b028 (#62704), then 1ba3ce45bfa872956d0fd03ff5023e8a93768be3 (#64706), preserving the two original commits' authors and messages.

  • #62704 adds EOF/no-progress recovery and preserves partial V8 headers. #64706 reads frame lengths as unsigned integers. Applying #64706 alone on v22 would leave high-bit lengths waiting for incomplete frames and expose the drain hang fixed by #62704.

  • The only manual conflict resolution adds StringFromCharCode without the unrelated String import present on main. The test changes merge into v22's existing setup. git range-diff shows only those surrounding context differences. Changes are limited to lib/internal/test_runner/runner.js and test/parallel/test-runner-v8-deserializer.mjs.
  • Validation

    Base: 839480a471e0f5dfe6dd2a6255ad66ddd99e3c14 (v22.x-staging, v22.23.3-pre). Environment: Linux x64, GCC 13.3.0, Python 3.12.3.

    Built the unchanged base and each backport revision locally. The regression test is test/parallel/test-runner-v8-deserializer.mjs.

    | Revision | Regression tests | FF 0F 7F FF FF FF stdout | FF 0F 80 00 00 00 stdout |
    | --- | --- | --- | --- |
    | Unchanged base | 31 passed | Hangs; SIGKILL required | Exits with failure |
    | #62704 only | 36 passed | Passes | Exits with failure |
    | Both backports | 37 passed | Passes | Passes |

    Both binary-stdout cases were checked with --test and with --test --test-force-exit. An external timeout bounded the baseline hangs. A direct FileTest.parseMessage() check also confirmed the unsigned case's deserialization error on the unchanged base.

  • /usr/bin/python3 tools/test.py -j4 --abort-on-timeout -p tap '/test-runner-': passed (55 cases, including 1 built-in skip).

  • make lint PYTHON=/usr/bin/python3 CPPLINT_QUIET='--quiet --repository=.' JOBS=4: passed. The repository override prevents cpplint from using the enclosing checkout when checking header guards; it does not disable those checks.

  • make -j4 test PYTHON=/usr/bin/python3 JOBS=4 TEST_CI_ARGS='--abort-on-timeout -p tap': passed (exit 0). All 4,731 JavaScript/addon cases completed without unexpected failures, including 39 built-in skips. C++ tests (164), doctool tests (7), and tool tests (5) also passed.
  • Runtime tests ran outside the execution sandbox, with NO_COLOR, FORCE_COLOR, and NODE_DISABLE_COLORS unset. The final full run also used TERM=xterm-256color. Inherited NO_COLOR=1 caused two color-output failures, and TERM=dumb caused nine REPL failures in the first full run. Both sets reproduced on the unchanged base and passed there with the corrected environment, and all passed in the final full backport run. No test or snapshot changes were made for these environment issues.

    Could a backporter apply the appropriate v22 backport labels to the original PRs, and could a collaborator or triager start full CI for this PR?

    Refs: https://github.com/nodejs/node/pull/62704
    Refs: https://github.com/nodejs/node/pull/64706
    Refs: https://github.com/nodejs/node/issues/62693
    Refs: https://github.com/nodejs/node/issues/64061

    Diff: 502 lines (+376 / -126) across 6 files Reviewer: MoLow Review duration: 58158m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.55) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.55 · 502 lines diff across 6 files
    0.55
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.372
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #65807"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 54.5% (MEDIUM) · Higher = larger blast radius
    54.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 30.2% · Safe to merge
    30.2%
    Repository