Google is committed to advancing racial equity for Black communities. See how.

BaseRetryDecision

public class BaseRetryDecision
extends Object implements IRetryDecision

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.

static getFailedTestCases( previousResults)

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

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.

boolean isAutoRetryEnabled()

Whether or not to enable auto-retry.

boolean rebootAtLastAttempt()

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

void setInvocationContext(IInvocationContext context)

Set the current invocation context.

boolean shouldRetry(IRemoteTest test, int attemptJustExecuted, previousResults)

Decide whether or not retry should be attempted.

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.

getFailedTestCases

public static  getFailedTestCases ( previousResults)

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

Parameters
previousResults

Returns

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

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

setInvocationContext

public void setInvocationContext (IInvocationContext context)

Set the current invocation context.

Parameters
context IInvocationContext

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