node/test/parallel/test-v8-collect-gc-profile-in-worker.js
theanarkh b3663e0262
test: fix test-v8-collect-gc-profile-in-worker.js
PR-URL: https://github.com/nodejs/node/pull/46735
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2023-02-24 10:11:16 +00:00

17 lines
345 B
JavaScript

// Flags: --expose-gc
'use strict';
require('../common');
const { Worker } = require('worker_threads');
const { testGCProfiler } = require('../common/v8');
if (!process.env.isWorker) {
process.env.isWorker = 1;
new Worker(__filename);
} else {
testGCProfiler();
for (let i = 0; i < 100; i++) {
new Array(100);
}
global?.gc();
}