IShardableTest

public interface IShardableTest
implements IRemoteTest

com.android.tradefed.testtype.IShardableTest


A IRemoteTest that can be split into separately executable sub-tests. The splitting into sub-tests is expected to be deterministic and each sub-test should be independent in order to allow for execution of different shards on different hosts.

Summary

Public methods

default Collection<IRemoteTest> split()

Shard the test into separately runnable chunks.

default Collection<IRemoteTest> split(int shardCountHint)

Alternative version of split() which also provides the shardCount that is attempted to be run.

Public methods

split

public Collection<IRemoteTest> split ()

Shard the test into separately runnable chunks.

This must be deterministic and always return the same list of IRemoteTests for the same input.

This will be called before test execution, so injected dependencies (such as the ITestDevice for IDeviceTests) may be null.

Returns
Collection<IRemoteTest> a collection of subtests to be executed separately or null if test is not currently shardable

split

public Collection<IRemoteTest> split (int shardCountHint)

Alternative version of split() which also provides the shardCount that is attempted to be run. This is useful for some test runner that cannot arbitrarly decide sometimes.

Parameters
shardCountHint int: the attempted shard count.

Returns
Collection<IRemoteTest> a collection of subtests to be executed separately or null if test is not currently shardable