Skip to content
Permalink
Browse files

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>
  • Loading branch information...
Trott authored and targos committed Jun 27, 2019
1 parent 3f6f968 commit 8a64b70efe9207f4eaad818780ab3088c91899fe
Showing with 17 additions and 15 deletions.
  1. +0 −2 test/known_issues/known_issues.status
  2. +17 −13 test/known_issues/test-vm-timeout-escape-nexttick.js
@@ -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
@@ -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 8a64b70

Please sign in to comment.
You can’t perform that action at this time.