node/test/node-api/test_worker_terminate_finalization/test.js
Anna Henningsen cf5d7c0140
test: skip node-api/test_worker_terminate_finalization
The test fails under ASAN/valgrind. Since it has not been working
properly until today anyway, skip it.

Refs: https://github.com/nodejs/node/issues/34731

PR-URL: https://github.com/nodejs/node/pull/34732
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
2020-08-11 18:36:51 -07:00

24 lines
810 B
JavaScript

'use strict';
const common = require('../../common');
// TODO(addaleax): Run this test once it stops failing under ASAN/valgrind.
// Refs: https://github.com/nodejs/node/issues/34731
common.skip('Reference management in N-API leaks memory');
const { Worker, isMainThread } = require('worker_threads');
if (isMainThread) {
const worker = new Worker(__filename);
worker.on('error', common.mustNotCall());
} else {
const { Test } =
require(`./build/${common.buildType}/test_worker_terminate_finalization`);
// Spin up thread and call add-on create the right sequence
// of rerences to hit the case reported in
// https://github.com/nodejs/node-addon-api/issues/722
// will crash if run under debug and its not possible to
// create object in the specific finalizer
Test(new Object());
}