GranularRetriableTestWrapper
public
class
GranularRetriableTestWrapper
extends Object
implements
IRemoteTest,
ITestCollector
| java.lang.Object
|
| ↳ |
com.android.tradefed.testtype.suite.GranularRetriableTestWrapper
|
A wrapper class works on the IRemoteTest to granulate the IRemoteTest in testcase level.
An IRemoteTest can contain multiple testcases. Previously, these testcases are treated as a
whole: When IRemoteTest runs, all testcases will run. Some IRemoteTest (The ones that implements
ITestFilterReceiver) can accept an allowlist of testcases and only run those testcases. This
class takes advantage of the existing feature and provides a more flexible way to run test suite.
- Single testcase can be retried multiple times (within the same IRemoteTest run) to reduce
the non-test-error failure rates.
- The retried testcases are dynamically collected from previous run failures.
Note:
- The prerequisite to run a subset of test cases is that the test type should implement the
interface
ITestFilterReceiver.
- X is customized max retry number.
Summary
Nested classes |
class |
GranularRetriableTestWrapper.StartEndCollector
Class helper to catch missing run start and end.
|
Public constructors |
GranularRetriableTestWrapper(IRemoteTest test, ITestInvocationListener mainListener, int maxRunLimit)
|
GranularRetriableTestWrapper(IRemoteTest test, ModuleDefinition module, ITestInvocationListener mainListener, int maxRunLimit)
|
GranularRetriableTestWrapper(IRemoteTest test, ModuleDefinition module, ITestInvocationListener mainListener, int maxRunLimit, boolean useModuleResultsForwarder, boolean removeModuleBuffering, boolean collectKernelLog, int targetPreparerRetryCount)
|
Public constructors
GranularRetriableTestWrapper
public GranularRetriableTestWrapper (IRemoteTest test,
ITestInvocationListener mainListener,
int maxRunLimit)
| Parameters |
test |
IRemoteTest |
mainListener |
ITestInvocationListener |
maxRunLimit |
int |
GranularRetriableTestWrapper
public GranularRetriableTestWrapper (IRemoteTest test,
ModuleDefinition module,
ITestInvocationListener mainListener,
int maxRunLimit)
| Parameters |
test |
IRemoteTest |
module |
ModuleDefinition |
mainListener |
ITestInvocationListener |
maxRunLimit |
int |
GranularRetriableTestWrapper
public GranularRetriableTestWrapper (IRemoteTest test,
ModuleDefinition module,
ITestInvocationListener mainListener,
int maxRunLimit,
boolean useModuleResultsForwarder,
boolean removeModuleBuffering,
boolean collectKernelLog,
int targetPreparerRetryCount)
| Parameters |
test |
IRemoteTest |
module |
ModuleDefinition |
mainListener |
ITestInvocationListener |
maxRunLimit |
int |
useModuleResultsForwarder |
boolean |
removeModuleBuffering |
boolean |
collectKernelLog |
boolean |
targetPreparerRetryCount |
int |
Public methods
getExpectedTestsCount
public final int getExpectedTestsCount ()
Calculate the number of testcases in the IRemoteTest. This value distincts the same
testcases that are rescheduled multiple times.
getFinalTestRunResults
public final List<TestRunResult> getFinalTestRunResults ()
Get the merged TestRunResults from each IRemoteTest run.
getResultListener
public ModuleListener getResultListener ()
Returns the listener containing all the results.
getRetryCount
public int getRetryCount ()
setCollectTestsOnly
public void setCollectTestsOnly (boolean shouldCollectTest)
Enables or disables test collection mode
setDefaultLogCollectors
public void setDefaultLogCollectors (List<IMetricCollector> collectors)
| Parameters |
collectors |
List |
setMarkTestsSkipped
public void setMarkTestsSkipped (boolean skipTestCases)
Set the ModuleDefinition RunStrategy as a GranularRetriableTestWrapper
attribute.
| Parameters |
skipTestCases |
boolean: whether the testcases should be skipped. |
setRetryDecision
public void setRetryDecision (IRetryDecision decision)
Sets the IRetryDecision to be used.
| Parameters |
decision |
IRetryDecision |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-06-22 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-22 UTC."],[],[]]