Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: capture stack trace in debugger timeout errors
Otherwise when the expected prompt does not show up in the
session and the debugger tests time out, there is not enough
information to figure out exactly which line in the test
is causing the timeout.
  • Loading branch information
joyeecheung committed Oct 28, 2025
commit 32b4ce58dbda8a4635ff90546d73e7f8fca863d6
8 changes: 4 additions & 4 deletions test/common/debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ function startCLI(args, flags = [], spawnOpts = {}, opts = { randomPort: true })
reject(new Error(message));
}

// Capture stack trace here to show where waitFor was called from when it times out.
const timeoutErr = new Error(`Timeout (${TIMEOUT}) while waiting for ${pattern}`);
const timer = setTimeout(() => {
tearDown();
reject(new Error([
`Timeout (${TIMEOUT}) while waiting for ${pattern}`,
`found: ${this.output}`,
].join('; ')));
timeoutErr.output = this.output;
reject(timeoutErr);
}, TIMEOUT);

function tearDown() {
Expand Down
Loading