Skip to content

Sharding does not work with ParametrizedTest in java_junit5_test #279

Open
@al-babych-fivetran

Description

@al-babych-fivetran

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions