jest
jest copied to clipboard
[Bug]: default jest config will sometimes result in shards with 0 tests
Version
28.1.3
Steps to reproduce
-
git clone [email protected]:jazzdan/jest-shard-bug.git
-
cd jest-shard-bug
-
yarn install
-
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
can i work on this issue?
Here's a replay of the issue, for what it's worth https://app.replay.io/recording/jest-shards-can-sometimes-have-0-tests-in-them--03c102a9-23de-4dff-9703-33c21e3103bc?point=649037107455789718243409532026952&time=1478.2236363636364&hasFrames=true
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.
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.
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.
/reopen
PR welcome!
Here's a replay of the issue, for what it's worth app.replay.io/recording/jest-shards-can-sometimes-have-0-tests-in-them--03c102a9-23de-4dff-9703-33c21e3103bc?point=649037107455789718243409532026952&time=1478.2236363636364&hasFrames=true
Super cool 😀
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.
@rahul3002 are you still up for sending a PR?
/cc @marionebl FYI
https://github.com/facebook/jest/releases/tag/v29.2.2
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.