test: spin longer on flaky platforms for test-worker-prof

Try spinning longer to get more ticks on flaky platforms
and reduce flakiness.

PR-URL: https://github.com/nodejs/node/pull/60492
Refs: https://github.com/nodejs/reliability/blob/main/reports/2025-10-29.md
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Joyee Cheung 2025-11-03 22:43:30 +01:00 committed by GitHub
parent ace8f6d60c
commit be3fc1f729
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,10 +16,16 @@ if (process.argv[2] === 'child') {
console.log('parent prof file:', parentProf);
const { Worker } = require('worker_threads');
let spinTime = 1500;
if (common.isWindows || common.isMacOS || process.arch === 's390x') {
// Windows and MacOS tend to be flaky in CI, s390x as well.
// Give them more spins.
spinTime = 4500;
}
const w = new Worker(`
const { parentPort, workerData } = require('worker_threads');
const SPIN_MS = 1500;
const SPIN_MS = ${spinTime};
const start = Date.now();
parentPort.on('message', (data) => {
if (Date.now() - start < SPIN_MS) {