I重试决策

public interface IRetryDecision

com.android.tradefed.retry.IRetryDecision


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

概括

公共方法

abstract void addLastAttempt ( lastResults) addLastAttempt ( lastResults)

ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List))很可能会在最后一次重试尝试之前被调用,因此出于统计目的,我们可能会丢失最后一次尝试的结果。

default void addToSkipRetryList (String filterEntry)

添加一个条目以跳过重试。

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, DeviceNotAvailableException dnae) shouldRetry ( IRemoteTest test, ModuleDefinition module, int attemptJustExecuted, previousResults, DeviceNotAvailableException dnae)

决定是否应尝试重试。

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

决定是否应重试模块准备。

abstract boolean useUpdatedReporting ()

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

公共方法

添加最后一次尝试

public abstract void addLastAttempt ( lastResults)

ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List))很可能会在最后一次重试尝试之前被调用,因此出于统计目的,我们可能会丢失最后一次尝试的结果。该方法允许提供这些结果以进行正确的统计计算。

添加跳过重试列表

public void addToSkipRetryList (String filterEntry)

添加一个条目以跳过重试。

参数
filterEntry String

获取最大重试次数

public abstract int getMaxRetryCount ()

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

退货
int

获取重试统计信息

public abstract RetryStatistics getRetryStatistics ()

返回表示重试的RetryStatistics

退货
RetryStatistics

获取重试策略

public abstract RetryStrategy getRetryStrategy ()

自动重试期间使用的RetryStrategy

退货
RetryStrategy

是否启用自动重试

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, 
                DeviceNotAvailableException dnae)

决定是否应尝试重试。还要对要重试的IRemoteTest进行任何必要的更改(应用过滤器等)。

参数
test IRemoteTest :刚刚运行的IRemoteTest

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

attemptJustExecuted int :我们刚刚运行的尝试的编号。

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

dnae DeviceNotAvailableException :设备不可用异常的DeviceNotAvailableException

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

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

应该重试准备

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

决定是否应重试模块准备。

参数
module ModuleDefinition

attempt int

maxAttempt int

退货
RetryPreparationDecision

使用更新报告

public abstract boolean useUpdatedReporting ()

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

退货
boolean