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

Sharding does not work with ParametrizedTest in java_junit5_test #279

Open
al-babych-fivetran opened this issue Jun 7, 2024 · 0 comments

Comments

@al-babych-fivetran
Copy link

All tests generated by @ParametrizedTest are executed in the single shard.

A simple example is available in the repo.
It has a parametrized test with 20 values:

@ParameterizedTest
  @ValueSource(ints = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20})
  public void passes(int value) throws InterruptedException {
    //...
    System.out.println("Test: " + value + ", Shard: " + shard);
   // ...
  }

The java_junit5_test has shard_count equal to 10.
All tests are executed in a single shard:

Test: 1, Shard: 8
Test: 19, Shard: 8
Test: 4, Shard: 8
Test: 5, Shard: 8
Test: 2, Shard: 8
Test: 3, Shard: 8
Test: 8, Shard: 8
Test: 9, Shard: 8
Test: 6, Shard: 8
Test: 7, Shard: 8
Test: 10, Shard: 8
Test: 20, Shard: 8
Test: 14, Shard: 8
Test: 13, Shard: 8
Test: 12, Shard: 8
Test: 11, Shard: 8
Test: 18, Shard: 8
Test: 17, Shard: 8
Test: 16, Shard: 8
Test: 15, Shard: 8

I see why this happened but is there any workaround for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant