Skip to content
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

Merged
merged 2 commits into from
Sep 6, 2023
Merged

Fix flaky CLI test #15932

merged 2 commits into from
Sep 6, 2023

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Sep 5, 2023

Q                       A
Fixed Issues? Re-enable the flaky babel-cli tests
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

@nicolo-ribaudo @liuxingbaoyu Can you checkout this PR locally and see if the flaky test is now fixed? Thanks.

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;
Copy link
Contributor Author

@JLHwung JLHwung Sep 5, 2023

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.

Copy link
Contributor Author

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

@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/55369/

@JLHwung JLHwung marked this pull request as ready for review September 5, 2023 22:09
Copy link
Member

@liuxingbaoyu liuxingbaoyu left a 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.

@JLHwung
Copy link
Contributor Author

JLHwung commented Sep 5, 2023

@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.

@liuxingbaoyu
Copy link
Member

Everything is fine. 🎉

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a 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 nicolo-ribaudo changed the title fix flaky CI test Fix flaky CLI test Sep 6, 2023
@nicolo-ribaudo nicolo-ribaudo merged commit ff4f959 into babel:main Sep 6, 2023
48 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the fix-flaky-test branch September 6, 2023 13:34
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Dec 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: tests outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants