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 0753bc1

Browse filesBrowse files
thefourtheyeevanlucas
authored andcommitted
test: increase timeout in break-on-uncaught
As the failures suggest, this test expects the uncaught exception to be thrown within 100 milliseconds, but on some of the test machines it takes longer than that limit to notify the exception. Thats why the test was failing. This patch polls every 10 ms to see if the exception is received. PR-URL: #10822 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
1 parent a8533ac commit 0753bc1
Copy full SHA for 0753bc1

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+5
-2
lines changed
Open diff view settings
Collapse file

‎test/debugger/test-debug-break-on-uncaught.js‎

Copy file name to clipboardExpand all lines: test/debugger/test-debug-break-on-uncaught.js
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ function runScenario(scriptName, throwsOnLine, next) {
7373
client.connect(port);
7474
}
7575

76+
let interval;
7677
function runTest(client) {
7778
client.req(
7879
{
@@ -91,20 +92,22 @@ function runScenario(scriptName, throwsOnLine, next) {
9192

9293
client.reqContinue(function(error) {
9394
assert.ifError(error);
94-
setTimeout(assertHasPaused.bind(null, client), 100);
95+
interval = setInterval(assertHasPaused.bind(null, client), 10);
9596
});
9697
}
9798
);
9899
}
99100

100101
function assertHasPaused(client) {
101-
assert(exceptions.length, 'no exceptions thrown, race condition in test?');
102+
if (!exceptions.length) return;
103+
102104
assert.strictEqual(exceptions.length, 1,
103105
'debugger did not pause on exception');
104106
assert.strictEqual(exceptions[0].uncaught, true);
105107
assert.strictEqual(exceptions[0].script.name, testScript);
106108
assert.strictEqual(exceptions[0].sourceLine + 1, throwsOnLine);
107109
asserted = true;
108110
client.reqContinue(assert.ifError);
111+
clearInterval(interval);
109112
}
110113
}

0 commit comments

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