Skip to content

debugger: wait for target startup before initialization - #64304

Open
Archkon wants to merge 3 commits into
nodejs:mainfrom
Archkon:fixtest
Open

debugger: wait for target startup before initialization#64304
Archkon wants to merge 3 commits into
nodejs:mainfrom
Archkon:fixtest

Conversation

@Archkon

@Archkon Archkon commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Trying to fix the test error that triggered at previous pr when run github action ci/cd

https://github.com/nodejs/node/actions/runs/28730483133/job/85195106458?pr=64301

@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 5, 2026
@trivikr

trivikr commented Jul 5, 2026

Copy link
Copy Markdown
Member

Several previous attempts of deflaking were unsuccessful.
Please refer #64116 for prior discussions and links to other PRs.

@Archkon

Archkon commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Several previous attempts of deflaking were unsuccessful. Please refer #64116 for prior discussions and links to other PRs.

Ok, I got it .Thanks !

@Archkon
Archkon marked this pull request as draft July 6, 2026 05:26
@Archkon
Archkon force-pushed the fixtest branch 3 times, most recently from 88fe3e7 to 1e6cde7 Compare July 29, 2026 23:48
@Archkon Archkon changed the title debugger: defer pause to avoid pause forever debugger: wait for target startup before initialization Jul 29, 2026
@Archkon
Archkon marked this pull request as ready for review July 29, 2026 23:58
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.49123% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.14%. Comparing base (e7904d4) to head (28953e2).

Files with missing lines Patch % Lines
lib/internal/debugger/inspect_helpers.js 95.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64304      +/-   ##
==========================================
- Coverage   90.14%   90.14%   -0.01%     
==========================================
  Files         746      746              
  Lines      242764   242819      +55     
  Branches    45739    45754      +15     
==========================================
+ Hits       218848   218895      +47     
+ Misses      15426    15425       -1     
- Partials     8490     8499       +9     
Files with missing lines Coverage Δ
lib/internal/debugger/inspect_probe.js 82.14% <100.00%> (+<0.01%) ⬆️
lib/internal/debugger/inspect_repl.js 91.36% <100.00%> (+0.05%) ⬆️
lib/internal/debugger/inspect_helpers.js 97.00% <95.23%> (-0.41%) ⬇️

... and 19 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.

@Archkon

Archkon commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@joyeecheung @trivikr Could you take a look at this? I believe this would fix the flaky tests that related to timou of macos ci

@avivkeller
avivkeller requested review from joyeecheung and trivikr and removed request for joyeecheung August 5, 2026 02:05
@Archkon

Archkon commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@joyeecheung @trivikr Please take a look at this

@joyeecheung

Copy link
Copy Markdown
Member

I think at the minimum the commit should explain why the previous flakes happen, and why the change is supposed to fix it?

Archkon added 3 commits August 6, 2026 23:15
The debugger endpoint can accept a connection before the target has
entered its startup wait. In that window,Runtime.runIfWaitingForDebugger
may be handled too early, leaving the target waiting indefinitely.

Use NodeRuntime.waitingForDebugger as a readiness handshake before
initializing the debugger domains and releasing the target. Apply the
handshake to both the interactive debugger and probe mode,and reject the
wait if the session closes.

Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
Debugger tests spawn a debugger client and target process, then wait for
asynchronous CLI output through a shared test helper.Under high parallel
load on macOS, process scheduling and inspector communication can delay
progress beyond the existing 15-second timeout, causing intermittent
failures across multiple debugger tests.

Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
Run the debugger CLI in the per-test temporary directory so concurrent
runs do not overwrite or remove the same node.cpuprofile file.

Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
@Archkon

Archkon commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

@joyeecheung I have tried stress test for all test/parallel/test-debugger-*x1000 with -j 16 and all passed
You could refer to
https://github.com/Archkon/node/actions/runs/30611428496/job/91094848364
https://github.com/Archkon/node/actions/runs/30611440979/job/91094888598
https://github.com/Archkon/node/actions/runs/30611450116/job/91094920610

And also select one of flaky tests to run 1 million times to check and before github aciton timeout no one would fail
https://github.com/Archkon/node/actions/runs/30514960670/job/90782618615

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debugger Issues and PRs related to the debugger subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants