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]: default jest config will sometimes result in shards with 0 tests #13027

Closed
jazzdan opened this issue Jul 14, 2022 · 11 comments · Fixed by #13476
Closed

[Bug]: default jest config will sometimes result in shards with 0 tests #13027

jazzdan opened this issue Jul 14, 2022 · 11 comments · Fixed by #13476

Comments

@jazzdan
Copy link

jazzdan commented Jul 14, 2022

Version

28.1.3

Steps to reproduce

  1. git clone git@github.com:jazzdan/jest-shard-bug.git
  2. cd jest-shard-bug
  3. yarn install
  4. yarn reproduce

Expected behavior

I would expect the 12/12 shards to contain at least 1 test, ideally 4. There are 55 tests and 12 shards. I would expect each shard to contain at least 4 tests since 55/12 = 4 and some change.

Actual behavior

Instead the 12th shard contains 0 tests, which is an error by default in jest.

I know I can implement my own test sequencer but it was surprising to me that using the default sequencer with a default jest config and shards could result in an error.

Additional context

No response

Environment

System:
    OS: macOS 12.4
    CPU: (10) arm64 Apple M1 Max
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
  npmPackages:
    jest: ^28.1.3 => 28.1.3
@rahul3002
Copy link

can i work on this issue?

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Aug 18, 2022
@github-actions
Copy link

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@github-actions
Copy link

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@rahul3002
Copy link

/reopen

@SimenB SimenB reopened this Sep 19, 2022
@github-actions github-actions bot removed the Stale label Sep 19, 2022
@SimenB
Copy link
Member

SimenB commented Sep 19, 2022

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Oct 19, 2022
@SimenB
Copy link
Member

SimenB commented Oct 19, 2022

@rahul3002 are you still up for sending a PR?

/cc @marionebl FYI

@github-actions github-actions bot removed the Stale label Oct 19, 2022
marionebl added a commit to marionebl/jest that referenced this issue Oct 19, 2022
marionebl added a commit to marionebl/jest that referenced this issue Oct 19, 2022
@SimenB SimenB linked a pull request Oct 19, 2022 that will close this issue
@SimenB
Copy link
Member

SimenB commented Oct 24, 2022

@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 Nov 24, 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