-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix flaky CLI test #15932
Fix flaky CLI test #15932
Conversation
if (this.options.useFsEvents && this._fsEventsHandler) { | ||
if (!this._readyCount) this._readyCount = paths.length; | ||
- if (this.options.persistent) this._readyCount *= 2; | ||
+ if (this.options.persistent) this._readyCount += paths.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like an upstream bug to me, because
watcher.add(["a.js"]); watcher.add(["b.js"]); watcher.add(["c.js"])
should yield the same _readyCount
(currently 8) as calling watcher.add(["a.js", "b.js", "c.js"])
(currently 6). However I am not familiar with the chokidar codebase at all, so I create an ad-hoc patch here and see if it is sufficient to save that test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The upstream PR: paulmillr/chokidar#1288
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/55369/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I cannot reproduce the failure locally.
@liuxingbaoyu I know. Does this PR break on Windows locally? If not then we should be good. I've run the test locally for 10 times and it passes every time, previously it almost fails every time. |
Everything is fine. 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, this works locally :)
@nicolo-ribaudo @liuxingbaoyu Can you checkout this PR locally and see if the flaky test is now fixed? Thanks.