Skip to content

test: unflake debugger and REPL tests - #64718

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
mcollina:fix-macos-test-flakes
Aug 3, 2026
Merged

test: unflake debugger and REPL tests#64718
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
mcollina:fix-macos-test-flakes

Conversation

@mcollina

@mcollina mcollina commented Jul 24, 2026

Copy link
Copy Markdown
Member

Refs: https://github.com/nodejs/node/actions/runs/30080039199/job/89439279468?pr=64339

The macOS job exposed three independent test races:

  • test-debugger-extract-function-name only checks formatting from the exec
    command, but synchronized on an unrelated initial-break message. Run it
    against an auto-resumed, long-lived target and synchronize directly on the
    debugger prompt instead.
  • test-repl-user-error-handler could receive an inspector
    Promise was collected evaluation error before the user error it intended to
    assert. Give this focused handleError test a synchronous VM evaluator,
    submit the throwing and follow-up expressions separately, and await clean
    REPL teardown.
  • test-debug-prompt relied on a nonexistent target and had no assertion,
    timeout, or child-process lifecycle handling. Use a long-lived debugger
    target, assert that the prompt is received, and report startup/exit failures
    instead of hanging.

Validation:

  • python3 tools/test.py test/sequential/test-debug-prompt.js
  • python3 tools/test.py parallel/test-debugger-extract-function-name parallel/test-repl-user-error-handler
  • targeted ESLint
  • commit-message validation

@nodejs-github-bot nodejs-github-bot added debugger Issues and PRs related to the debugger subsystem. needs-ci PRs that need a full CI run. labels Jul 24, 2026

@avivkeller avivkeller left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, but note that the flake won't be entirely resolved until https://chromium-review.googlesource.com/c/v8/v8/+/8123081 lands1

Footnotes

  1. Running async, as you've done, makes this far more unlikely, but there's still a chance of it catching itself, if GC occurs at a poor time

@avivkeller avivkeller added the repl Issues and PRs related to the REPL subsystem. label Jul 24, 2026
@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 24, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 24, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.14%. Comparing base (c558c8e) to head (9e4ff2c).
⚠️ Report is 130 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64718      +/-   ##
==========================================
- Coverage   90.15%   90.14%   -0.01%     
==========================================
  Files         741      744       +3     
  Lines      242251   242517     +266     
  Branches    45624    45686      +62     
==========================================
+ Hits       218391   218608     +217     
- Misses      15351    15407      +56     
+ Partials     8509     8502       -7     

see 66 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@avivkeller avivkeller added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 25, 2026
@avivkeller

Copy link
Copy Markdown
Member

@mcollina

=== release test-debug-prompt ===
Path: sequential/test-debug-prompt
Error: Command: out/Release/node /home/runner/work/node/node/node/test/sequential/test-debug-prompt.js

Run the debugger function-formatting checks against an auto-resumed,
long-lived target so they do not depend on initial-break rendering.

Use a synchronous VM evaluator for the REPL handleError test. Submit the
throwing input separately and wait for clean REPL teardown.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
@mcollina
mcollina force-pushed the fix-macos-test-flakes branch from 58ed4da to dd871fa Compare July 25, 2026 08:01
@avivkeller avivkeller added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 25, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 25, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Use a long-lived debugger target and assert that the prompt is received
before sending the exit command.

Handle child exit and timeout failures explicitly instead of leaving the
test hanging when startup does not produce a prompt.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
@avivkeller

avivkeller commented Jul 27, 2026

Copy link
Copy Markdown
Member

LGTM, but note that the flake won't be entirely resolved until https://chromium-review.googlesource.com/c/v8/v8/+/8123081 lands1

Footnotes

  1. Running async, as you've done, makes this far more unlikely, but there's still a chance of it catching itself, if GC occurs at a poor time

Example: https://github.com/nodejs/node/actions/runs/30196530330/job/89779074224?pr=64718#step:8:4444

But my V8 fix is about to land, and I'll backport it to this repo

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 29, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 29, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@mcollina mcollina added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 1, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Aug 1, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/64718
✔  Done loading data for nodejs/node/pull/64718
----------------------------------- PR info ------------------------------------
Title      test: unflake debugger and REPL tests (#64718)
Author     Matteo Collina <matteo.collina@gmail.com> (@mcollina)
Branch     mcollina:fix-macos-test-flakes -> nodejs:main
Labels     repl, author ready, needs-ci, debugger
Commits    2
 - test: unflake debugger and REPL tests
 - test: harden debugger prompt test
Committers 1
 - Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/64718
Refs: https://github.com/nodejs/node/actions/runs/30080039199/job/89439279468?pr=64339
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/64718
Refs: https://github.com/nodejs/node/actions/runs/30080039199/job/89439279468?pr=64339
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Fri, 24 Jul 2026 15:10:29 GMT
   ✔  Approvals: 2
   ✔  - Aviv Keller (@avivkeller): https://github.com/nodejs/node/pull/64718#pullrequestreview-4779560305
   ✔  - Yagiz Nizipli (@anonrig) (TSC): https://github.com/nodejs/node/pull/64718#pullrequestreview-4782846063
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2026-07-29T18:38:33Z: https://ci.nodejs.org/job/node-test-pull-request/75298/
- Querying data for job/node-test-pull-request/75298/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 64718
From https://github.com/nodejs/node
 * branch                  refs/pull/64718/merge -> FETCH_HEAD
✔  Fetched commits as 276fe2be450a..9e4ff2c2518a
--------------------------------------------------------------------------------
[main 0bc99a5a24] test: unflake debugger and REPL tests
 Author: Matteo Collina <hello@matteocollina.com>
 Date: Sat Jul 25 10:01:09 2026 +0200
 2 files changed, 27 insertions(+), 11 deletions(-)
[main 9f119395f6] test: harden debugger prompt test
 Author: Matteo Collina <hello@matteocollina.com>
 Date: Sun Jul 26 10:26:44 2026 +0100
 1 file changed, 37 insertions(+), 9 deletions(-)
   ✔  Patches applied
There are 2 commits in the PR. Attempting autorebase.
(node:347) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
(Use `node --trace-deprecation ...` to show where the warning was created)
Rebasing (2/4)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test: unflake debugger and REPL tests

Run the debugger function-formatting checks against an auto-resumed,
long-lived target so they do not depend on initial-break rendering.

Use a synchronous VM evaluator for the REPL handleError test. Submit the
throwing input separately and wait for clean REPL teardown.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: #64718
Refs: https://github.com/nodejs/node/actions/runs/30080039199/job/89439279468?pr=64339
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>

[detached HEAD 08bc35edb1] test: unflake debugger and REPL tests
Author: Matteo Collina <hello@matteocollina.com>
Date: Sat Jul 25 10:01:09 2026 +0200
2 files changed, 27 insertions(+), 11 deletions(-)
Rebasing (3/4)
Rebasing (4/4)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test: harden debugger prompt test

Use a long-lived debugger target and assert that the prompt is received
before sending the exit command.

Handle child exit and timeout failures explicitly instead of leaving the
test hanging when startup does not produce a prompt.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: #64718
Refs: https://github.com/nodejs/node/actions/runs/30080039199/job/89439279468?pr=64339
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>

[detached HEAD bb2f00979f] test: harden debugger prompt test
Author: Matteo Collina <hello@matteocollina.com>
Date: Sun Jul 26 10:26:44 2026 +0100
1 file changed, 37 insertions(+), 9 deletions(-)
Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/30717992856

@mcollina mcollina added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Aug 3, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 3, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 219dbd6 into nodejs:main Aug 3, 2026
92 of 93 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 219dbd6

aduh95 pushed a commit that referenced this pull request Aug 3, 2026
Run the debugger function-formatting checks against an auto-resumed,
long-lived target so they do not depend on initial-break rendering.

Use a synchronous VM evaluator for the REPL handleError test. Submit the
throwing input separately and wait for clean REPL teardown.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: #64718
Refs: https://github.com/nodejs/node/actions/runs/30080039199/job/89439279468?pr=64339
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. debugger Issues and PRs related to the debugger subsystem. needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants