summaryrefslogtreecommitdiff
path: root/test/abort
diff options
context:
space:
mode:
authorGabriel Schulhof <gabriel.schulhof@intel.com>2018-12-05 17:24:49 -0800
committerGabriel Schulhof <gabriel.schulhof@intel.com>2018-12-19 18:35:38 -0800
commit13abc6adfb9f6a53618ca7d533d31b6a5d26dcec (patch)
treec926fad94aa23bf3bec5af81b975efa0771338da /test/abort
parent622e348d8f70a4ec006ee1ce9207a6a5bc3fc325 (diff)
downloadandroid-node-v8-13abc6adfb9f6a53618ca7d533d31b6a5d26dcec.tar.gz
android-node-v8-13abc6adfb9f6a53618ca7d533d31b6a5d26dcec.tar.bz2
android-node-v8-13abc6adfb9f6a53618ca7d533d31b6a5d26dcec.zip
src: unload addons when environment quits
This is an alternative to https://github.com/nodejs/node/pull/23319 which attaches the loaded addons to the environment and closes them when the environment is destroyed. PR-URL: https://github.com/nodejs/node/pull/24861 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'test/abort')
-rw-r--r--test/abort/test-addon-uv-handle-leak.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/abort/test-addon-uv-handle-leak.js b/test/abort/test-addon-uv-handle-leak.js
index 96608f8dda..b67c5f7136 100644
--- a/test/abort/test-addon-uv-handle-leak.js
+++ b/test/abort/test-addon-uv-handle-leak.js
@@ -18,6 +18,16 @@ if (!fs.existsSync(bindingPath))
common.skip('binding not built yet');
if (process.argv[2] === 'child') {
+
+ // The worker thread loads and then unloads `bindingPath`. Because of this the
+ // symbols in `bindingPath` are lost when the worker thread quits, but the
+ // number of open handles in the worker thread's event loop is assessed in the
+ // main thread afterwards, and the names of the callbacks associated with the
+ // open handles is retrieved at that time as well. Thus, we require
+ // `bindingPath` here so that the symbols and their names survive the life
+ // cycle of the worker thread.
+ require(bindingPath);
+
new Worker(`
const binding = require(${JSON.stringify(bindingPath)});