Skip to content

Commit 7e3ba67

Browse files
committed
test: deflake test-watch-file-shared-dependency
Delay dependency file modification on macOS. Refs: nodejs#51842
1 parent 48c75bc commit 7e3ba67

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/parallel/test-watch-file-shared-dependency.mjs

+15-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@ describe('watch file with shared dependency', () => {
4949
watcher.unfilterFilesOwnedBy([fixturePaths['test.js']]);
5050
watcher.filterFile(fixturePaths['test.js']);
5151
watcher.filterFile(fixturePaths['dependency.js'], fixturePaths['test.js']);
52-
writeFileSync(fixturePaths['dependency.js'], 'module.exports = { modified: true };');
52+
53+
if (common.isMacOS) {
54+
// Do the write with a delay to ensure that the OS is ready to notify us.
55+
setTimeout(() => {
56+
writeFileSync(
57+
fixturePaths['dependency.js'],
58+
'module.exports = { modified: true };'
59+
);
60+
}, common.platformTimeout(200));
61+
} else {
62+
writeFileSync(
63+
fixturePaths['dependency.js'],
64+
'module.exports = { modified: true };'
65+
);
66+
}
5367
});
5468
});

0 commit comments

Comments
 (0)