Skip to content

Commit d3b5d31

Browse files
committed
test: deflake test-fs-promises-watch-iterator
Add a delay before writing the files to ensure that the watcher receives the notifications. Fixes: #60051 Refs: #52601
1 parent c6316f9 commit d3b5d31

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/parallel/test-fs-promises-watch-iterator.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ class WatchTestCase {
3434
}
3535
}
3636
async writeFiles() {
37+
// Do the write with a delay to ensure that the OS is ready to notify us.
38+
await setTimeout(common.platformTimeout(100));
39+
3740
for (const fileName of [...this.files]) {
3841
await writeFile(this.filePath(fileName), Date.now() + fileName.repeat(1e4));
3942
}
40-
await setTimeout(common.platformTimeout(100));
4143
}
4244
}
4345

0 commit comments

Comments
 (0)