You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
parallel/test-fs-promises-watch-iterator is flaky #60051
There seems to be a race condition where some (sometimes all) events are missing. If a small delay is added before writing the files the flakiness goes away
The test is meant to test that multiple file events are all handled when following in rapid succession. The sleep at the beginning is fine. As a matter of fact it should make things more stable as the the initial watcher setup is completed during that. The original test depends on asynchronous functions executing code before the first awai synchronously therefore staring the watcher before writing files.
So your instinct in moving the sleep up is good and we should do that. It won’t impact the test’s value so long as there is no sleep in between file writes.
Activity
lpinca commentedon Sep 28, 2025
I can reproduce the issue on my mac by running the following command:
There seems to be a race condition where some (sometimes all) events are missing. If a small delay is added before writing the files the flakiness goes away
Anyway, I'm not sure if the above patch invalidates the test or hides an actual bug in the watch/iterator implementation.
gurgunday commentedon Sep 28, 2025
Yeah I thought about moving the timeout up too but had the same concern
pipobscure commentedon Sep 30, 2025
The test is meant to test that multiple file events are all handled when following in rapid succession. The sleep at the beginning is fine. As a matter of fact it should make things more stable as the the initial watcher setup is completed during that. The original test depends on asynchronous functions executing code before the first awai synchronously therefore staring the watcher before writing files.
So your instinct in moving the sleep up is good and we should do that. It won’t impact the test’s value so long as there is no sleep in between file writes.
test: deflake test-fs-promises-watch-iterator
test: deflake test-fs-promises-watch-iterator
test: deflake test-fs-promises-watch-iterator
test: deflake test-fs-promises-watch-iterator
test: deflake test-fs-promises-watch-iterator