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 pnpm run test run #1635

Closed
7 of 10 tasks
ST-DDT opened this issue Dec 6, 2022 · 8 comments · Fixed by #1763
Closed
7 of 10 tasks

Fix pnpm run test run #1635

ST-DDT opened this issue Dec 6, 2022 · 8 comments · Fixed by #1763
Labels
c: bug Something isn't working has workaround Workaround provided or linked p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Milestone

Comments

@ST-DDT
Copy link
Member

ST-DDT commented Dec 6, 2022

Pre-Checks

Describe the bug

pnpm run test run fails due to tests timing out.

test/locale-imports.spec.ts > locale imports > Internal tests to cover src/locale/*.ts > should be possible to directly import('../src/locale/af_ZA')
Error: Test timed out in 5000ms.
If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".

  ❯ test/locale-imports.spec.ts (232) 41438ms
   ❯ locale imports (232) 41437ms
     ✓ should be possible to directly require('@faker-js/faker/locale/af_ZA')
     ✓ should be possible to directly import('@faker-js/faker/locale/af_ZA') 1009ms
     ❯ Internal tests to cover `src/locale/*.ts` (2) 5035ms
       ✓ should be possible to directly require('../locale/af_ZA')
       × should be possible to directly import('../src/locale/af_ZA') 5027ms
     ✓ should be possible to directly require('@faker-js/faker/locale/ar')
     ✓ should be possible to directly import('@faker-js/faker/locale/ar') 4299ms
     ✓ Internal tests to cover `src/locale/*.ts` (2) 805ms
     ✓ should be possible to directly require('@faker-js/faker/locale/az')
     ✓ should be possible to directly import('@faker-js/faker/locale/az') 387ms

Minimal reproduction code

  • pnpm run test run

Additional Context

These two previously worked:

  • pnpm run test
  • pnpm run test run test/locale-imports.spec.ts

Environment Info

System:
    OS: Windows 10 10.0.22621
    CPU: (16) x64 Intel(R) Core(TM) i7-7820X CPU @ 3.60GHz
    Memory: 53.93 GB / 63.69 GB
  Binaries:
    Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 8.16.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.819.0), Chromium (108.0.1462.42)
    Internet Explorer: 11.0.22621.1

Which module system do you use?

  • CJS
  • ESM

Used Package Manager

pnpm

@ST-DDT ST-DDT added c: bug Something isn't working p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug labels Dec 6, 2022
@Shinigami92 Shinigami92 changed the title Fix pnpn run test run Fix pnpm run test run Dec 6, 2022
@Shinigami92
Copy link
Member

I do not have timeouts anymore, but running the tests take tremendously huge amount of time (~20 min)
Looks like the all_functional and locales tests take >1k seconds
For me it feels like this is too long and we should try to bring them down to something faster

@ST-DDT
Copy link
Member Author

ST-DDT commented Jan 10, 2023

This also seems to affect the normal tests: pnpm run test

Workaround:

CI=true pnpm run test
CI=true pnpm run test watch

@ST-DDT ST-DDT added the has workaround Workaround provided or linked label Jan 10, 2023
@Shinigami92
Copy link
Member

@matthewmayer
Copy link
Contributor

could we make CI=true the default for the time being? to avoid scaring off new contributors who might not understand why the tests are not working.

@Shinigami92
Copy link
Member

could we make CI=true the default for the time being? to avoid scaring off new contributors who might not understand why the tests are not working.

I would prefer to put some pressure on vitest-dev/vitest#2612 so the need is there

@matthewmayer
Copy link
Contributor

hmm i was fairly convinced i had broken my local setup for a week or so as the tests kept failing because i didn't know about this issue, which discouraged me from working on faker for a while.

Maybe you could add a message when pnpm run test is run without the flag, like "Due to a bug in vitest, tests may run very slowly. If your test run gets stuck, rerun with CI=true pnpm run test"

@Shinigami92
Copy link
Member

It was more like "I do not want to put effort when the root cause will already get fixed in next few days"
That effort needs to be reverted when the new reporter has landed which results in double effort

@ST-DDT
Copy link
Member Author

ST-DDT commented Jan 22, 2023

Fixed by #1762

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working has workaround Workaround provided or linked p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants