shardIndex property

int? shardIndex
final

The index of the current shard, if sharding is in use, or null if it's not.

Sharding is a technique that allows the Google internal test framework to easily split a test run across multiple workers without requiring the tests to be modified by the user. When sharding is in use, the runner gets a shard index (this field) and a total number of shards, and is expected to provide the following guarantees:

  • Running the same invocation of the runner, with the same shard index and total shards, will run the same set of tests.
  • Across all shards, each test must be run exactly once.

In addition, tests should be balanced across shards as much as possible.

Implementation

final int? shardIndex;