mirror of
https://github.com/nodejs/node.git
synced 2025-12-27 23:41:14 +00:00
test: apply a delay to watch-mode-kill-signal tests
The test is still flaking on macOS. This might be caused by fs event coalescing. Apply a delay to reduce the chance of it. Also, add a bit more logs to show more information. PR-URL: https://github.com/nodejs/node/pull/60610 Refs: https://github.com/nodejs/reliability/blob/main/reports/2025-11-07.md Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
parent
8a76958005
commit
bd3a202133
5
test/fixtures/kill-signal-for-watch.js
vendored
5
test/fixtures/kill-signal-for-watch.js
vendored
@ -7,4 +7,7 @@ process.on('SIGINT', () => {
|
||||
process.exit();
|
||||
});
|
||||
process.send(`script ready ${process.pid}`);
|
||||
setTimeout(() => {}, 100_000);
|
||||
const timeout = 100_000;
|
||||
setTimeout(() => {
|
||||
process._rawDebug(`[CHILD] Timeout ${timeout} fired`);
|
||||
}, timeout);
|
||||
|
||||
@ -51,7 +51,12 @@ child.on('message', (msg) => {
|
||||
const match = msg.match(/script ready (\d+)/);
|
||||
if (match) {
|
||||
firstGrandchildPid = match[1]; // This is the first grandchild
|
||||
writeFileSync(indexPath, indexContents);
|
||||
const writeDelay = 1000; // Delay to reduce the chance of fs events coalescing
|
||||
console.log(`[PARENT] writing to restart ${firstGrandchildPid} after ${writeDelay}ms`);
|
||||
setTimeout(() => {
|
||||
console.log(`[PARENT] writing to ${indexPath} to restart ${firstGrandchildPid}`);
|
||||
writeFileSync(indexPath, indexContents);
|
||||
}, writeDelay);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -52,7 +52,12 @@ child.on('message', (msg) => {
|
||||
const match = msg.match(/script ready (\d+)/);
|
||||
if (match) {
|
||||
firstGrandchildPid = match[1]; // This is the first grandchild
|
||||
writeFileSync(indexPath, indexContents);
|
||||
const writeDelay = 1000; // Delay to reduce the chance of fs events coalescing
|
||||
console.log(`[PARENT] writing to restart ${firstGrandchildPid} after ${writeDelay}ms`);
|
||||
setTimeout(() => {
|
||||
console.log(`[PARENT] writing to ${indexPath} to restart ${firstGrandchildPid}`);
|
||||
writeFileSync(indexPath, indexContents);
|
||||
}, writeDelay);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user