Skip to content

Commit 6c2b3af

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 6c2b3af

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/all.js

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

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

0 commit comments

Comments
 (0)