Skip to content

Commit 6ba1e69

Browse files
committed
fix(test): force process exit after all tests finish
In debug builds, a Node.js-internal referenced async handle keeps the event loop alive after all tests complete. This is not caused by the native addon — all addon handles are verified stopped via per-object create/stop tracking. This does not occur in release builds. Use tape's onFinish callback to exit with the appropriate code.
1 parent 002d713 commit 6ba1e69

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/all.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
/* eslint no-process-exit:0 */
12
"use strict";
23

34
// require('child_process').spawnSync('pause', {shell: true, stdio: 'inherit'});
45
//
6+
7+
// In debug builds, a Node.js-internal referenced async handle keeps the event
8+
// loop alive after all tests complete (not caused by the native addon — all
9+
// addon handles are verified stopped). This does not occur in release builds.
10+
var test = require("tape");
11+
test.onFinish(() => process.exit(test._exitCode));
12+
513
require("./addicecandidate");
614
require("./closing-data-channel");
715
require("./closing-peer-connection");

0 commit comments

Comments
 (0)