Skip to content

Commit

Permalink
test: fix flaky test-async-wrap-uncaughtexception
Browse files Browse the repository at this point in the history
It's possible for `beforeExit` to be emitted more than once if work is
scheduled by its listeners. Accommodate this fact in the test.

Fixes: nodejs#16210
  • Loading branch information
Trott committed Oct 30, 2017
1 parent b8888f5 commit a200dbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-async-wrap-uncaughtexception.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ hooks = async_hooks.createHook({
}).enable();


process.on('uncaughtException', common.mustCall(() => {
process.once('uncaughtException', common.mustCall(() => {
assert.strictEqual(call_id, async_hooks.executionAsyncId());
call_log[2]++;
}));
Expand Down

0 comments on commit a200dbb

Please sign in to comment.