Skip to content

Commit

Permalink
test: fix flaky test-process-fatal-execption-tick
Browse files Browse the repository at this point in the history
Use common.busyLoop() which happens to make the test robust.

PR-URL: #18461
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
  • Loading branch information
Trott committed Jan 31, 2018
1 parent 0993fbe commit a025723
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test/parallel/test-process-fatal-exception-tick.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ setImmediate(() => {
stage++;
process.nextTick(() => assert.strictEqual(stage, 2));
});
const now = Date.now();
setTimeout(() => setImmediate(() => stage++), 1);
while (now + 10 >= Date.now());
common.busyLoop(10);
throw new Error('caughtException');

0 comments on commit a025723

Please sign in to comment.