Skip to content

Commit 92a909c

Browse files
joyeecheungaduh95
authored andcommitted
debugger,test: deflake resume failure test and add debug logs
On slow CI, the outer Debugger.resume can be picked up in the same drain pass as the Debugger.evaluateOnCallFrame, while V8 still considers the context paused. In this case both resume calls may succeed and the process can continue running from the setInterval until the timeout. Accept both probe failure and timeout as valid to accommodate this flakiness. This patch also adds more debug logs to the probe mode to show more information in case it flakes again in the CI Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com> PR-URL: #63524 Fixes: #63505 Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 59cca26 commit 92a909c

3 files changed

Lines changed: 49 additions & 8 deletions

File tree

‎lib/internal/debugger/inspect_probe.js‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const {
2525

2626
const { clearTimeout, setTimeout } = require('timers');
2727
const { SideEffectFreeRegExpPrototypeSymbolReplace } = require('internal/util');
28+
const debug = require('internal/util/debuglog').debuglog('inspect_probe');
2829

2930
const InspectClient = require('internal/debugger/inspect_client');
3031
const {
@@ -477,6 +478,7 @@ class ProbeInspectorSession {
477478

478479
finish(exitCode, terminal) {
479480
if (this.finished) { return; }
481+
debug('finish: exitCode=%d, terminal=%s', exitCode, terminal?.event);
480482
this.finished = true;
481483
if (this.timeout !== null) {
482484
clearTimeout(this.timeout);
@@ -523,6 +525,8 @@ class ProbeInspectorSession {
523525
}
524526

525527
onChildExit(code, signal) {
528+
debug('child exit: code=%s signal=%s connected=%s started=%s finished=%s inFlight=%j',