Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ccc2637

Browse filesBrowse files
joyeecheungaduh95
authored andcommitted
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. PR-URL: #60457 Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 6877139 commit ccc2637
Copy full SHA for ccc2637

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Open diff view settings
Collapse file

‎test/common/debugger.js‎

Copy file name to clipboardExpand all lines: test/common/debugger.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ function startCLI(args, flags = [], spawnOpts = {}, opts = { randomPort: true })
8888
reject(new Error(message));
8989
}
9090

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

9999
function tearDown() {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.