Skip to content

Commit

Permalink
test: fix flaky test-vm-timeout-escape-nexttick
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Jun 27, 2019
1 parent 6045fbb commit 6810113
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
2 changes: 0 additions & 2 deletions test/known_issues/known_issues.status
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ test-vm-timeout-escape-promise: PASS,FLAKY
[$system==aix]

[$arch==arm]
# https://github.com/nodejs/node/issues/24120
test-vm-timeout-escape-nexttick: PASS,FLAKY
30 changes: 17 additions & 13 deletions test/known_issues/test-vm-timeout-escape-nexttick.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,20 @@ function loop() {
}
}

assert.throws(() => {
vm.runInNewContext(
'nextTick(loop); loop();',
{
hrtime,
nextTick,
loop
},
{ timeout: common.platformTimeout(10) }
);
}, {
code: 'ERR_SCRIPT_EXECUTION_TIMEOUT'
});
// The bug won't happen 100% reliably so run the test a small number of times to
// make sure we catch it if the bug exists.
for (let i = 0; i < 4; i++) {
assert.throws(() => {
vm.runInNewContext(
'nextTick(loop); loop();',
{
hrtime,
nextTick,
loop
},
{ timeout: common.platformTimeout(10) }
);
}, {
code: 'ERR_SCRIPT_EXECUTION_TIMEOUT'
});
}

0 comments on commit 6810113

Please sign in to comment.