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

IAutoRetriableTest

public interface IAutoRetriableTest
implements IRemoteTest

com.android.tradefed.testtype.retry.IAutoRetriableTest


Interface for an IRemoteTest that doesn't implement ITestFilterReceiver but still wishes to support auto-retry.

The recommendation for most runners is to implement ITestFilterReceiver and give granular control over what tests are running for the harness to handle. But in some situation, it might not be possible and some delegated form of retry is necessary.

Summary

Public methods

default void recoverStateOfDevices( devices, int attemptJustExecuted)

Recovery attempt on the device to get it a better state before next retry.

default boolean shouldRetry(int attemptJustExecuted, previousResults)

Delegated from ERROR(IRetryDecision#shouldRetry(IRemoteTest, int, List)/com.android.tradefed.retry.IRetryDecision#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List) IRetryDecision#shouldRetry(IRemoteTest, int, List)).

Public methods

recoverStateOfDevices

public void recoverStateOfDevices ( devices, 
                int attemptJustExecuted)

Recovery attempt on the device to get it a better state before next retry. Will only be triggered if ERROR(/#shouldRetry(int,List)) returns true.

Parameters
devices : The list of ITestDevice to apply recovery on.

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

shouldRetry

public boolean shouldRetry (int attemptJustExecuted, 
                 previousResults)

Delegated from ERROR(IRetryDecision#shouldRetry(IRemoteTest, int, List)/com.android.tradefed.retry.IRetryDecision#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List) IRetryDecision#shouldRetry(IRemoteTest, int, List)). Decide whether or not retry should be attempted. Also make any necessary changes to the IRemoteTest to be retried (Applying filters, preparing next run, etc.).

Parameters
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 Can be thrown during device recovery