test: avoid flaky debugger restart waits#61773
Conversation
6dd9cf9 to
c3b82fc
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61773 +/- ##
==========================================
- Coverage 89.78% 89.77% -0.01%
==========================================
Files 674 674
Lines 204957 204957
Branches 39391 39398 +7
==========================================
- Hits 184011 184006 -5
- Misses 13214 13221 +7
+ Partials 7732 7730 -2 🚀 New features to boost your workflow:
|
87a24df to
58aeec7
Compare
|
Quick update: this flake reproduced again in Test macOS (run https://github.com/nodejs/node/actions/runs/22255995247), with the same timeout path in |
58aeec7 to
e6adfbe
Compare
|
Quick update on local verification (macOS 15.7.4, Apple M2 Pro). I ran stress checks from an unusual-character path to match the CI scenario: UNUSUAL="$HOME/dir with \$unusual\"chars?'åß∂ƒ©∆¬…\`"
mkdir -p "$UNUSUAL"
ln -sfn "$PWD" "$UNUSUAL/node"
cd "$UNUSUAL/node"
./tools/test.py -p actions -j1 --repeat 50 \
parallel/test-debugger-restart-message \
parallel/test-debugger-run-after-quit-restart
./tools/test.py -p actions -j4 --repeat 100 \
parallel/test-debugger-restart-message \
parallel/test-debugger-run-after-quit-restartResults:
Since I could not reproduce this locally, I cannot claim high confidence that this change fixes the flake; however, if possible, running CI multiple times on this diff should help validate whether it reduces recurrence. |
|
node-test-linux-alpine-latest-x64 failed during checkout (before running tests): Looks like a CI workspace issue unrelated to this PR. https://ci.nodejs.org/job/node-test-commit-linux/nodes=alpine-latest-x64/68594/console |
Summary
stepCommand('restart')withcommand('restart')in:test/parallel/test-debugger-restart-message.jstest/parallel/test-debugger-run-after-quit-restart.jstest-debugger-restart-message, wait forDebugger attached.and prompt before asserting the listening message counttest-debugger-run-after-quit-restart, continue to assert behavior viawaitForInitialBreak()andbreakInfoContext
test-macOShas shown intermittent timeouts while waiting forBREAK_MESSAGEin restart-related debugger tests.In failing logs, reconnect succeeds (
Debugger attached.is printed), but the expectedbreak ... inline is not observed before timeout.Hypothesis
The flake is likely caused by a timing race in CLI output ordering around restart/reconnect:
stepCommand()requiresBREAK_MESSAGEto appearbreak ... inoutput is delayed or missed by this wait patternThis change does not claim to prove a single root cause. It may be related to timing behavior in
test/common/debugger.js, but this PR only narrows these two tests to a less fragile synchronization path aligned with what each test is actually verifying.Why this approach
BREAK_MESSAGEwait specifically forrestartTesting
out/Release/node test/parallel/test-debugger-restart-message.js(passes locally)out/Release/node test/parallel/test-debugger-run-after-quit-restart.js(passes locally)Refs: #61762