BaseRetryDecision

public class BaseRetryDecision
extends Object implements IConfigurationReceiver, IRetryDecision, ITestInformationReceiver

java.lang.Object
   ↳ com.android.tradefed.retry.BaseRetryDecision


Base implementation of IRetryDecision. Base implementation only take local signals into account.

Summary

Public constructors

BaseRetryDecision()

Constructor for the retry decision

Public methods

void addLastAttempt( lastResults)

ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List)) will most likely be called before the last retry attempt, so we might be missing the very last attempt results for statistics purpose.

void addToSkipRetryList(String filterEntry)

Add an entry to skip retrying it.

static getFailedTestCases( previousResults)

Returns the map of failed test cases that should be retried.

CurrentInvocation.IsolationGrade getIsolationGrade()
int getMaxRetryCount()

The maximum number of attempts during auto-retry.

RetryStatistics getRetryStatistics()

Returns the RetryStatistics representing the retry.

RetryStrategy getRetryStrategy()

The RetryStrategy used during auto-retry.

getSkipRetrySet()
TestInformation getTestInformation()
boolean isAutoRetryEnabled()

Whether or not to enable auto-retry.

boolean rebootAtLastAttempt()

Whether or not to reboot the device before the last attempt.

void setConfiguration(IConfiguration configuration)

Injects the IConfiguration in use.

void setInvocationContext(IInvocationContext context)

Set the current invocation context.

void setTestInformation(TestInformation testInformation)
boolean shouldRetry(IRemoteTest test, ModuleDefinition module, int attemptJustExecuted, previousResults, DeviceNotAvailableException dnae)

Decide whether or not retry should be attempted.

boolean shouldRetry(IRemoteTest test, int attemptJustExecuted, previousResults)

Decide whether or not retry should be attempted.

RetryPreparationDecision shouldRetryPreparation(ModuleDefinition module, int attempt, int maxAttempt)

Decide whether or not the module preparation should be retried.

boolean useUpdatedReporting()

Returns true if we should use the updated reporting.

Protected methods

void isolateRetry( devices)

Public constructors

BaseRetryDecision

public BaseRetryDecision ()

Constructor for the retry decision

Public methods

addLastAttempt

public void addLastAttempt ( lastResults)

ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List)) will most likely be called before the last retry attempt, so we might be missing the very last attempt results for statistics purpose. This method allows those results to be provided for proper statistics calculations.

addToSkipRetryList

public void addToSkipRetryList (String filterEntry)

Add an entry to skip retrying it.

Parameters
filterEntry String

getFailedTestCases

public static  getFailedTestCases ( previousResults)

Returns the map of failed test cases that should be retried.

Parameters
previousResults

Returns

getIsolationGrade

public CurrentInvocation.IsolationGrade getIsolationGrade ()

Returns
CurrentInvocation.IsolationGrade

getMaxRetryCount

public int getMaxRetryCount ()

The maximum number of attempts during auto-retry.

Returns
int

getRetryStatistics

public RetryStatistics getRetryStatistics ()

Returns the RetryStatistics representing the retry.

Returns
RetryStatistics

getRetryStrategy

public RetryStrategy getRetryStrategy ()

The RetryStrategy used during auto-retry.

Returns
RetryStrategy

getSkipRetrySet

public  getSkipRetrySet ()

Returns

getTestInformation

public TestInformation getTestInformation ()

Returns
TestInformation

isAutoRetryEnabled

public boolean isAutoRetryEnabled ()

Whether or not to enable auto-retry.

Returns
boolean

rebootAtLastAttempt

public boolean rebootAtLastAttempt ()

Whether or not to reboot the device before the last attempt.

Returns
boolean

setConfiguration

public void setConfiguration (IConfiguration configuration)

Injects the IConfiguration in use.

Parameters
configuration IConfiguration

setInvocationContext

public void setInvocationContext (IInvocationContext context)

Set the current invocation context.

Parameters
context IInvocationContext

setTestInformation

public void setTestInformation (TestInformation testInformation)

Parameters
testInformation TestInformation

shouldRetry

public boolean shouldRetry (IRemoteTest test, 
                ModuleDefinition module, 
                int attemptJustExecuted, 
                 previousResults, 
                DeviceNotAvailableException dnae)

Decide whether or not retry should be attempted. Also make any necessary changes to the IRemoteTest to be retried (Applying filters, etc.).

Parameters
test IRemoteTest: The IRemoteTest that just ran.

module ModuleDefinition: The ModuleDefinition object for the test module.

attemptJustExecuted int: The number of the attempt that we just ran.

previousResults : The list of TestRunResult of the test that just ran.

dnae DeviceNotAvailableException: The DeviceNotAvailableException of device not available exception.

Returns
boolean True if we should retry, False otherwise.

Throws
DeviceNotAvailableException

shouldRetry

public boolean shouldRetry (IRemoteTest test, 
                int attemptJustExecuted, 
                 previousResults)

Decide whether or not retry should be attempted. Also make any necessary changes to the IRemoteTest to be retried (Applying filters, etc.).

Parameters
test IRemoteTest: The IRemoteTest that just ran.

attemptJustExecuted int: The number of the attempt that we just ran.

previousResults : The list of TestRunResult of the test that just ran.

Returns
boolean True if we should retry, False otherwise.

Throws
DeviceNotAvailableException

shouldRetryPreparation

public RetryPreparationDecision shouldRetryPreparation (ModuleDefinition module, 
                int attempt, 
                int maxAttempt)

Decide whether or not the module preparation should be retried.

Parameters
module ModuleDefinition

attempt int

maxAttempt int

Returns
RetryPreparationDecision

useUpdatedReporting

public boolean useUpdatedReporting ()

Returns true if we should use the updated reporting.

Returns
boolean

Protected methods

isolateRetry

protected void isolateRetry ( devices)

Parameters
devices

Throws
DeviceNotAvailableException