IRetry决策
public interface IRetryDecision
com.android.tradefed.retry.IRetryDecision |
接口驱动重试决策,并在类上应用过滤器以实现更有针对性的重试。
概要
公开方法 | |
---|---|
abstract void | addLastAttempt ( lastResults) addLastAttempt ( lastResults) |
abstract int | getMaxRetryCount () 自动重试期间的最大尝试次数。 |
abstract RetryStatistics | getRetryStatistics () 返回表示重试的 |
abstract RetryStrategy | getRetryStrategy () 自动重试期间使用的 |
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) 确定是否应重试。 |
公开方法
addLastAttempt
public abstract void addLastAttempt (lastResults)
ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List))
最有可能在上次重试尝试之前调用,因此出于统计目的,我们可能会丢失最后一次尝试的结果。此方法允许将这些结果提供给适当的统计信息计算。
getMaxRetryCount
public abstract int getMaxRetryCount ()
自动重试期间的最大尝试次数。
退货 | |
---|---|
int |
getRetryStatistics
public abstract RetryStatistics getRetryStatistics ()
返回表示重试的RetryStatistics
。
退货 | |
---|---|
RetryStatistics |
getRetryStrategy
public abstract RetryStrategy getRetryStrategy ()
自动重试期间使用的RetryStrategy
。
退货 | |
---|---|
RetryStrategy |
isAutoRetryEnabled
public abstract boolean isAutoRetryEnabled ()
是否启用自动重试。
退货 | |
---|---|
boolean |
rebootAtLastAttempt
public abstract boolean rebootAtLastAttempt ()
在上一次尝试之前是否重新引导设备。
退货 | |
---|---|
boolean |
setInvocationContext
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 | 可以在设备恢复期间抛出 |