From a200dbbe0671fccb1bcf690e99529f91f7c7cc28 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 29 Oct 2017 19:44:49 -0700 Subject: [PATCH] test: fix flaky test-async-wrap-uncaughtexception 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: https://github.com/nodejs/node/issues/16210 --- test/parallel/test-async-wrap-uncaughtexception.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-async-wrap-uncaughtexception.js b/test/parallel/test-async-wrap-uncaughtexception.js index 9427e2fb787a9b..a1398decf845eb 100644 --- a/test/parallel/test-async-wrap-uncaughtexception.js +++ b/test/parallel/test-async-wrap-uncaughtexception.js @@ -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]++; }));