debugger: wait for target startup - #65194
Conversation
The inspector can accept a connection before an --inspect-brk target enters its frontend wait. Runtime.runIfWaitingForDebugger can then be handled too early, allowing the target to subsequently block forever. Wait for NodeRuntime.waitingForDebugger before initializing and releasing launched targets. Race the handshake against disconnects and apply it to both interactive and probe startup. Refs: nodejs#64116 Assisted-by: codex:gpt-5.6-sol Co-authored-by: Archkon <180910180+Archkon@users.noreply.github.com> Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com> Signed-off-by: Filip Skokan <panva.ip@gmail.com>
f206372 to
821e267
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #65194 +/- ##
==========================================
+ Coverage 90.32% 90.33% +0.01%
==========================================
Files 760 751 -9
Lines 248525 250395 +1870
Branches 46894 47339 +445
==========================================
+ Hits 224488 226206 +1718
- Misses 15469 15553 +84
- Partials 8568 8636 +68
🚀 New features to boost your workflow:
|
|
I ran
The A/B result suggests this likely fixes the flake, and the code looks good to me. My only non-blocking nit is the lack of a probe-mode disconnect test while |
This comment was marked as outdated.
This comment was marked as outdated.
|
Thanks for adding the probe disconnect test!
This suggests that the startup handshake may deflake debugger tests beyond Additional validation: stress test for
|
Important
This ought to deflake
parallel/test-debugger-profileandparallel/test-debugger-exceptions.The inspector can accept a connection before an --inspect-brk target enters its frontend wait. Runtime.runIfWaitingForDebugger can then be handled too early, allowing the target to subsequently block forever.
Wait for NodeRuntime.waitingForDebugger before initializing and releasing launched targets. Race the handshake against disconnects and apply it to both interactive and probe startup.
Refs: #64116
Assisted-by: codex:gpt-5.6-sol