-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add --fix-to-stdout back #307
Conversation
16fe56d
to
b34fea1
Compare
This is very frustrating. It's always the same integration test failing, always on some other version of eslint, and I cannot reproduce locally. |
I think you can try clean linux environment? It's reproducible on my machine - this test fails with random eslint version my setup is: then I just cloned this branch, run npm ci, then npm test:integration -- --timeout 10000 |
This is what I get from stderr:
|
config content: |
I've added check here that port not valid, now seems to not having any issues with exactly this test: Line 61 in b34fea1
but another appeared:
|
Well, just adding check didn't help, issue is really flaky, sometime it pass, sometime no, now it has no errors and still fails, I guess it might be that daemon / eslint crashes for some reasons and that's why there's no output 🤔 |
Weird I am also on linux but cannot reproduce the issue. ❯ cat /etc/lsb-release
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: /etc/lsb-release
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ DISTRIB_ID=Ubuntu
2 │ DISTRIB_RELEASE=22.04
3 │ DISTRIB_CODENAME=jammy
4 │ DISTRIB_DESCRIPTION="Ubuntu 22.04.4 LTS"
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ nr
✔ script to run › test:integration
> [email protected] test:integration
> mocha --bail --slow 1000 test/test.integration.js
..................................................
50 passing (3s) |
Are you on correct branch? this branch contains 70 tests, in your output only 50
|
🫠Was interrupted by something and forget to change branch. Yeah got the same error in cli ❯ nr
✔ script to run › test:integration
> [email protected] test:integration
> mocha --bail --slow 1000 test/test.integration.js
......................................................!
54 passing (4s)
1 failing
1) integration tests
--fix-to-stdout
v6.0.x
when file only contains fixable problems
prints input if no change is needed:
AssertionError: [assert.equals] '' expected to be equal to "console.log('Hello eslint');"
+ expected - actual
+console.log('Hello eslint');
at Object.fail (node_modules/@sinonjs/referee/lib/create-fail.js:5:21)
at Object.fail (node_modules/@sinonjs/referee/lib/define-assertion/index.js:47:17)
at assertion (node_modules/@sinonjs/referee/lib/define-assertion/index.js:65:11)
at referee.<computed>.<computed> [as equals] (node_modules/@sinonjs/referee/lib/define-assertion/index.js:92:22)
at Context.<anonymous> (file:///home/ray/git/eslint_d.js/test/test.integration.js:209:20)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
|
No problem, to see error you could swap assets in test this way:
|
Also if you run tests several time then some of runs could be successful, really weird |
Same here tried run 10 times succeed once. The version failed for me only 5 or 6, but saw 8 in CI. |
As a quick-fix solution we could use retry feature from mocha, long term this flaky test should be fixed |
Regarding this issue, for some weird reasons it stucks on |
replacing with
makes this test much more robust in my environment |
deea790
to
828fe51
Compare
@L2jLiga @RayGuo-ergou Thank you so much for helping debug this. It turns out that the startup sequence with file watches is quite aggressive regarding timings, so as far as I understand it now, it can happen that the config file appears on the file system, but the |
This option was lost in the recent rewrite.
Happy to help and @L2jLiga did all the work 😄. And Hi @mantoni and @DamienCassou , I really want to say thank you for make this happening! |
828fe51
to
c49b6dd
Compare
📦 Released in |
This includes the work from @DamienCassou made in #298 with more unit tests and documentation.
Fixes #295