0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/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();
}