• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2const common = require('../../common');
3
4// TODO(addaleax): Run this test once it stops failing under ASAN/valgrind.
5// Refs: https://github.com/nodejs/node/issues/34731
6// Refs: https://github.com/nodejs/node/pull/35777
7// Refs: https://github.com/nodejs/node/issues/35778
8common.skip('Reference management in N-API leaks memory');
9
10const { Worker, isMainThread } = require('worker_threads');
11
12if (isMainThread) {
13  const worker = new Worker(__filename);
14  worker.on('error', common.mustNotCall());
15} else {
16  const { Test } =
17    require(`./build/${common.buildType}/test_worker_terminate_finalization`);
18
19  // Spin up thread and call add-on create the right sequence
20  // of rerences to hit the case reported in
21  // https://github.com/nodejs/node-addon-api/issues/722
22  // will crash if run under debug and its not possible to
23  // create object in the specific finalizer
24  Test(new Object());
25}
26