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

[Bug]: test "typescript - reads config from ts file when package.json#type=module" is flaky #12558

Closed
F3n67u opened this issue Mar 8, 2022 · 11 comments · Fixed by #12560
Closed

Comments

@F3n67u
Copy link
Contributor

F3n67u commented Mar 8, 2022

Version

N/A

Steps to reproduce

The typescript config test needs @jest/types to be built. we run tsc -b packages/jest-types in beforeAll and set a 60s timeout, but this command run more than 60s occasionally at ci. I cannot reproduce it on my local macOS computer.

https://github.com/facebook/jest/runs/5465229008?check_suite_focus=true#step:8:7

Run yarn test-ci-partial:parallel --max-workers 3 --shard=3/[4](https://github.com/facebook/jest/runs/5465229008?check_suite_focus=true#step:8:4)
...........................................................
/Users/runner/work/jest/jest/e2e/__tests__/esmConfigFile.test.ts

  ● on node >=12.17.0 › typescript › reads config from ts file when package.json#type=module

    thrown: "Exceeded timeout of 60000 ms for a hook.
    Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

      [5](https://github.com/facebook/jest/runs/5465229008?check_suite_focus=true#step:8:5)0 |
      51 |   describe('typescript', () => {
    > 52 |     beforeAll(async () => {
         |     ^
      53 |       // the typescript config test needs `@jest/types` to be built
      54 |       const cwd = resolve(__dirname, '../../');
      55 |       const typesPackageDirectory = 'packages/jest-types';

      at beforeAll (e2e/__tests__/esmConfigFile.test.ts:52:5)
      at describe (e2e/__tests__/esmConfigFile.test.ts:51:3)
      at Object.<anonymous> (e2e/__tests__/esmConfigFile.test.ts:2[6](https://github.com/facebook/jest/runs/5465229008?check_suite_focus=true#step:8:6):1)

Setup MongoDB Test Environment
Teardown MongoDB Test Environment
..................................................

Error: Process completed with exit code 1.

Expected behavior

The test is timeout after 60s and failed.

Actual behavior

Test fail occasionly.fails

Additional context

No response

Environment

N/A
@SimenB
Copy link
Member

SimenB commented Mar 8, 2022

This only started happening after #12521 (comment), no idea why. should probably revert it

@mrazauskas
Copy link
Contributor

Can be just a timeout as well. tsc is not only building types, but is also running full check of declaration files. This can take a lot of time on slower machines. (While working on slow computer, I was keeping "skipLibCheck": true just to stay sane.)

@F3n67u Would you be interested to send a PR with simply increased timeout? Just to see.

@SimenB
Copy link
Member

SimenB commented Mar 8, 2022

Happy to try out skiplibcheck for this test if applicable. Not for our actual type check, but this specific test would be fine 👍

@F3n67u
Copy link
Contributor Author

F3n67u commented Mar 9, 2022

I am wondering why not run yarn build instead of yarn build:js at ci to prepare everything?

@SimenB
Copy link
Member

SimenB commented Mar 9, 2022

Since it takes 6-7 minutes to do

@F3n67u
Copy link
Contributor Author

F3n67u commented Mar 9, 2022

Can be just a timeout as well. tsc is not only building types, but is also running full check of declaration files. This can take a lot of time on slower machines. (While working on slow computer, I was keeping "skipLibCheck": true just to stay sane.)

@F3n67u Would you be interested to send a PR with simply increased timeout? Just to see.

I filed a pr to increase timeout to 360s: #12560

@F3n67u
Copy link
Contributor Author

F3n67u commented Mar 9, 2022

CI turn green when increase timeout to 360s, see https://github.com/facebook/jest/runs/5481848898?check_suite_focus=true

@F3n67u
Copy link
Contributor Author

F3n67u commented Mar 9, 2022

@mrazauskas
Copy link
Contributor

@F3n67u Thanks! It was just a timeout? Nice. Seems like currently tsc does not allow to use --build and --skipLibCheck flags together. At least I don’t know how to make it work. So perhaps increasing timeout is fine.


Regarding the other issue. Not sure if that’s the same problem, but running yarn jest --detectOpenHandles locally (Node 17, macOS 12, Apple M1) points to "examples/react-native". Here is what I see running yarn jest --projects examples/react-native --detectOpenHandles:

Screenshot 2022-03-15 at 07 05 11

To be honest, I have no experience with React at all.

Perhaps it is worth to open a PR with "examples/react-native" removed (or disable)? Just to see if CircleCI will pass. If so, it would be clear where to look for the problem. I am just guessing again.

@F3n67u
Copy link
Contributor Author

F3n67u commented Mar 15, 2022

@SimenB could you help to merge this pr #12560 to make our ci greener?

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants