Skip to content

Commit

Permalink
fixup! test: fix flaky test-worker-prof
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Feb 17, 2021
1 parent 3fd9375 commit d8596e7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/sequential/test-worker-prof.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ if (process.argv[2] === 'child') {
parentPort.on('message', (m) => {
if (counter++ === 10)
process.exit(0);
parentPort.postMessage(
fs.readFileSync(m.toString()).slice(0, 1024 * 1024));
parentPort.postMessage(
fs.readFileSync(m.toString()).slice(0, 1024 * 1024));
});
`;

const { Worker } = require('worker_threads');
const w = new Worker(pingpong, { eval: true });
w.on('message', (m) => {
w.postMessage(process.execPath);
w.postMessage(__filename);
});

w.on('exit', common.mustCall(() => {
Expand All @@ -46,10 +46,10 @@ if (process.argv[2] === 'child') {
}
process.exit(0);
}));
w.postMessage(process.execPath);
w.postMessage(__filename);
} else {
tmpdir.refresh();
const timeout = common.platformTimeout(60_000);
const timeout = common.platformTimeout(30_000);
const spawnResult = spawnSync(
process.execPath, ['--prof', __filename, 'child'],
{ cwd: tmpdir.path, encoding: 'utf8', timeout });
Expand Down

0 comments on commit d8596e7

Please sign in to comment.