Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f0d81c9

Browse filesBrowse files
joyeecheungaduh95
authored andcommitted
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: #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>
1 parent 3e11658 commit f0d81c9
Copy full SHA for f0d81c9

File tree

Expand file treeCollapse file tree

3 files changed

+16
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+16
-3
lines changed
Open diff view settings
Collapse file

‎test/fixtures/kill-signal-for-watch.js‎

Copy file name to clipboardExpand all lines: test/fixtures/kill-signal-for-watch.js
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ process.on('SIGINT', () => {
77
process.exit();
88
});
99
process.send(`script ready ${process.pid}`);
10-
setTimeout(() => {}, 100_000);
10+
const timeout = 100_000;
11+
setTimeout(() => {
12+
process._rawDebug(`[CHILD] Timeout ${timeout} fired`);
13+
}, timeout);
Collapse file

‎test/parallel/test-watch-mode-kill-signal-default.mjs‎

Copy file name to clipboardExpand all lines: test/parallel/test-watch-mode-kill-signal-default.mjs
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ child.on('message', (msg) => {
5151
const match = msg.match(/script ready (\d+)/);
5252
if (match) {
5353
firstGrandchildPid = match[1]; // This is the first grandchild
54-
writeFileSync(indexPath, indexContents);
54+
const writeDelay = 1000; // Delay to reduce the chance of fs events coalescing
55+
console.log(`[PARENT] writing to restart ${firstGrandchildPid} after ${writeDelay}ms`);
56+
setTimeout(() => {
57+
console.log(`[PARENT] writing to ${indexPath} to restart ${firstGrandchildPid}`);
58+
writeFileSync(indexPath, indexContents);
59+
}, writeDelay);
5560
}
5661
}
5762
});
Collapse file

‎test/parallel/test-watch-mode-kill-signal-override.mjs‎

Copy file name to clipboardExpand all lines: test/parallel/test-watch-mode-kill-signal-override.mjs
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ child.on('message', (msg) => {
5252
const match = msg.match(/script ready (\d+)/);
5353
if (match) {
5454
firstGrandchildPid = match[1]; // This is the first grandchild
55-
writeFileSync(indexPath, indexContents);
55+
const writeDelay = 1000; // Delay to reduce the chance of fs events coalescing
56+
console.log(`[PARENT] writing to restart ${firstGrandchildPid} after ${writeDelay}ms`);
57+
setTimeout(() => {
58+
console.log(`[PARENT] writing to ${indexPath} to restart ${firstGrandchildPid}`);
59+
writeFileSync(indexPath, indexContents);
60+
}, writeDelay);
5661
}
5762
}
5863
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.