重试决定

public interface IRetryDecision

com.android.tradefed.retry.IRetryDecision


接口驱动重试决策并在类上应用过滤器以获得更有针对性的重试。

概括

公共方法

abstract void addLastAttempt ( lastResults) addLastAttempt ( lastResults)

ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List))将最有可能在最后一个试尝试之前调用,所以我们可能会丢失统计目的的最后尝试的结果。

abstract int getMaxRetryCount ()

自动重试期间的最大尝试次数。

abstract RetryStatistics getRetryStatistics ()

返回RetryStatistics代表重试。

abstract RetryStrategy getRetryStrategy ()

RetryStrategy自动重试时使用。

abstract boolean isAutoRetryEnabled ()

是否开启自动重试。

abstract boolean rebootAtLastAttempt ()

上次尝试前是否重启设备。

abstract void setInvocationContext (IInvocationContext context)

设置当前调用上下文。

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

决定是否应该尝试重试。

abstract boolean shouldRetry (IRemoteTest test, ModuleDefinition module, int attemptJustExecuted, previousResults) shouldRetry (IRemoteTest test, ModuleDefinition module, int attemptJustExecuted, previousResults)

决定是否应该尝试重试。

abstract boolean useUpdatedReporting ()

如果我们应该使用更新的报告,则返回 true。

公共方法

添加最后一次尝试

public abstract void addLastAttempt ( lastResults)

ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List))将最有可能在最后一个试尝试之前调用,所以我们可能会丢失统计目的的最后尝试的结果。该方法允许为适当的统计计算提供这些结果。

获取最大重试计数

public abstract int getMaxRetryCount ()

自动重试期间的最大尝试次数。

退货
int

获取重试统计信息

public abstract RetryStatistics getRetryStatistics ()

返回RetryStatistics代表重试。

退货
RetryStatistics

获取重试策略

public abstract RetryStrategy getRetryStrategy ()

RetryStrategy自动重试时使用。

退货
RetryStrategy

isAutoRetryEnabled

public abstract boolean isAutoRetryEnabled ()

是否开启自动重试。

退货
boolean

重新启动最后一次尝试

public abstract boolean rebootAtLastAttempt ()

上次尝试前是否重启设备。

退货
boolean

设置调用上下文

public abstract void setInvocationContext (IInvocationContext context)

设置当前调用上下文。

参数
context IInvocationContext

应该重试

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

决定是否应该尝试重试。另外,还要在必要的修改IRemoteTest重试(应用过滤器等)。

参数
test IRemoteTest :该IRemoteTest刚刚跑了。

attemptJustExecuted int :尝试的,我们只是跑的次数。

previousResults :列表TestRunResult测试,只是跑去。

退货
boolean如果我们应该重试,则为 True,否则为 False。

投掷
DeviceNotAvailableException可以在设备恢复期间抛出

应该重试

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

决定是否应该尝试重试。另外,还要在必要的修改IRemoteTest重试(应用过滤器等)。

参数
test IRemoteTest :该IRemoteTest刚刚跑了。

module ModuleDefinition :该ModuleDefinition对象的测试模块。

attemptJustExecuted int :尝试的,我们只是跑的次数。

previousResults :列表TestRunResult测试,只是跑去。

退货
boolean如果我们应该重试,则为 True,否则为 False。

投掷
DeviceNotAvailableException可以在设备恢复期间抛出

使用更新报告

public abstract boolean useUpdatedReporting ()

如果我们应该使用更新的报告,则返回 true。

退货
boolean