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 8a64b70

Browse filesBrowse files
Trotttargos
authored andcommitted
test: fix flaky test-vm-timeout-escape-nexttick
PR-URL: #28461 Fixes: #24120 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 3f6f968 commit 8a64b70
Copy full SHA for 8a64b70

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

+17
-15
lines changed
Open diff view settings
Collapse file

‎test/known_issues/known_issues.status‎

Copy file name to clipboardExpand all lines: test/known_issues/known_issues.status
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,3 @@ test-vm-timeout-escape-promise: PASS,FLAKY
2222
[$system==aix]
2323

2424
[$arch==arm]
25-
# https://github.com/nodejs/node/issues/24120
26-
test-vm-timeout-escape-nexttick: PASS,FLAKY
Collapse file

‎test/known_issues/test-vm-timeout-escape-nexttick.js‎

Copy file name to clipboardExpand all lines: test/known_issues/test-vm-timeout-escape-nexttick.js
+17-13Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,20 @@ function loop() {
2727
}
2828
}
2929

30-
assert.throws(() => {
31-
vm.runInNewContext(
32-
'nextTick(loop); loop();',
33-
{
34-
hrtime,
35-
nextTick,
36-
loop
37-
},
38-
{ timeout: common.platformTimeout(10) }
39-
);
40-
}, {
41-
code: 'ERR_SCRIPT_EXECUTION_TIMEOUT'
42-
});
30+
// The bug won't happen 100% reliably so run the test a small number of times to
31+
// make sure we catch it if the bug exists.
32+
for (let i = 0; i < 4; i++) {
33+
assert.throws(() => {
34+
vm.runInNewContext(
35+
'nextTick(loop); loop();',
36+
{
37+
hrtime,
38+
nextTick,
39+
loop
40+
},
41+
{ timeout: common.platformTimeout(10) }
42+
);
43+
}, {
44+
code: 'ERR_SCRIPT_EXECUTION_TIMEOUT'
45+
});
46+
}

0 commit comments

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