IAutoRetriableTest

public interface IAutoRetriableTest
implements IRemoteTest

com.android.tradefed.testtype.retry.IAutoRetriableTest


不实现 ITestFilterReceiver 但仍希望支持自动重试的 IRemoteTest 的接口。

对于大多数运行程序,建议实现 ITestFilterReceiver,并精细控制要运行哪些测试以供测试框架处理。但在某些情况下,这可能行不通,需要使用某种委托形式的重试。

摘要

公共方法

default boolean shouldRetry(int attemptJustExecuted, previousResults, skipList)

委托方:ERROR(IRetryDecision.shouldRetry(IRemoteTest, int, List)/com.android.tradefed.retry.IRetryDecision#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List) IRetryDecision.shouldRetry(IRemoteTest, int, List))

公共方法

shouldRetry

public boolean shouldRetry (int attemptJustExecuted, 
                 previousResults, 
                 skipList)

委托方:ERROR(IRetryDecision.shouldRetry(IRemoteTest, int, List)/com.android.tradefed.retry.IRetryDecision#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List) IRetryDecision.shouldRetry(IRemoteTest, int, List))。决定是否应尝试重试。此外,请对要重试的 IRemoteTest 进行必要的更改(应用过滤条件、准备下次运行等)。

参数
attemptJustExecuted int:我们刚刚运行的尝试次数。

previousResults :刚刚运行的测试的 TestRunResult 列表。

skipList :不应重试的一组项。

返回
boolean 如果应重试,则返回 True;否则返回 False。

抛出
DeviceNotAvailableException 可能会在设备恢复期间抛出