mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
test: deflake test-fs-promises-watch-iterator
Add a delay before writing the files to ensure that the watcher receives the notifications. Fixes: https://github.com/nodejs/node/issues/60051 Refs: https://github.com/nodejs/node/issues/52601 PR-URL: https://github.com/nodejs/node/pull/60060 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
parent
6dbf7086bb
commit
f8a43f6f34
|
|
@ -34,10 +34,12 @@ class WatchTestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async writeFiles() {
|
async writeFiles() {
|
||||||
|
// Do the write with a delay to ensure that the OS is ready to notify us.
|
||||||
|
await setTimeout(common.platformTimeout(100));
|
||||||
|
|
||||||
for (const fileName of [...this.files]) {
|
for (const fileName of [...this.files]) {
|
||||||
await writeFile(this.filePath(fileName), Date.now() + fileName.repeat(1e4));
|
await writeFile(this.filePath(fileName), Date.now() + fileName.repeat(1e4));
|
||||||
}
|
}
|
||||||
await setTimeout(common.platformTimeout(100));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user