IRetryDecision
public
interface
IRetryDecision
| com.android.tradefed.retry.IRetryDecision |
用于驱动重试决策并对类应用过滤器以实现更具针对性的重试的接口。
摘要
公共方法 | |
|---|---|
abstract
void
|
addLastAttempt(
|
default
void
|
addToSkipRetryList(String filterEntry)
添加一个条目以跳过重试。 |
abstract
|
getCommandLineArgs()
返回重试决策的命令行参数。 |
abstract
int
|
getMaxTestCaseAttempts()
自动重试期间,每次测试运行的尝试次数上限。 |
abstract
int
|
getMaxTestCaseAttempts(ModuleDefinition module)
自动重试期间,给定模块在每次测试运行中的尝试次数上限。 |
abstract
int
|
getMaxTestRunAttempts()
自动重试期间,每次测试运行的尝试次数上限。 |
abstract
int
|
getMaxTestRunAttempts(ModuleDefinition module)
自动重试期间,给定模块在每次测试运行中的尝试次数上限。 |
abstract
RetryStatistics
|
getRetryStatistics()
返回表示重试的 |
abstract
RetryStrategy
|
getRetryStrategy()
自动重试期间使用的 |
abstract
boolean
|
isAutoRetryEnabled()
是否启用自动重试。 |
abstract
boolean
|
rebootAtLastAttempt()
在最后一次尝试之前是否重启设备。 |
abstract
void
|
setInvocationContext(IInvocationContext context)
设置当前调用上下文。 |
abstract
boolean
|
shouldRetry(IRemoteTest test, ModuleDefinition module, int attemptJustExecuted,
决定是否应尝试重试。 |
abstract
boolean
|
shouldRetry(IRemoteTest test, int attemptJustExecuted,
决定是否应尝试重试。 |
abstract
RetryPreparationDecision
|
shouldRetryPreparation(ModuleDefinition module, int attempt, int maxAttempt)
确定是否应重试模块准备。 |
abstract
boolean
|
useUpdatedReporting()
如果应使用更新后的报告,则返回 true。 |
公共方法
addLastAttempt
public abstract void addLastAttempt (lastResults)
ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List)) 很可能会在最后一次重试尝试之前调用,因此我们可能会错过统计目的的最后一次尝试结果。通过这种方法,系统可以提供这些结果以进行适当的统计计算。
addToSkipRetryList
public void addToSkipRetryList (String filterEntry)
添加一个条目以跳过重试。
| 参数 | |
|---|---|
filterEntry |
String |
getCommandLineArgs
public abstractgetCommandLineArgs ()
返回重试决策的命令行参数。
| 返回 | |
|---|---|
|
|
getMaxTestCaseAttempts
public abstract int getMaxTestCaseAttempts ()
自动重试期间,每次测试运行的尝试次数上限。
| 返回 | |
|---|---|
int |
|
getMaxTestCaseAttempts
public abstract int getMaxTestCaseAttempts (ModuleDefinition module)
自动重试期间,给定模块在每次测试运行中的尝试次数上限。
| 参数 | |
|---|---|
module |
ModuleDefinition |
| 返回 | |
|---|---|
int |
|
getMaxTestRunAttempts
public abstract int getMaxTestRunAttempts ()
自动重试期间,每次测试运行的尝试次数上限。
| 返回 | |
|---|---|
int |
|
getMaxTestRunAttempts
public abstract int getMaxTestRunAttempts (ModuleDefinition module)
自动重试期间,给定模块在每次测试运行中的尝试次数上限。
| 参数 | |
|---|---|
module |
ModuleDefinition |
| 返回 | |
|---|---|
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 |
shouldRetry
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 |
可能会在设备恢复期间抛出 |
shouldRetry
public abstract boolean shouldRetry (IRemoteTest test, int attemptJustExecuted,previousResults)
决定是否应尝试重试。此外,请对要重试的 IRemoteTest 进行必要的更改(应用过滤条件等)。
| 参数 | |
|---|---|
test |
IRemoteTest:刚刚运行的 IRemoteTest。 |
attemptJustExecuted |
int:我们刚刚运行的尝试次数。 |
previousResults |
:刚刚运行的测试的 TestRunResult 列表。 |
| 返回 | |
|---|---|
boolean |
如果应重试,则返回 True;否则返回 False。 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
可能会在设备恢复期间抛出 |
shouldRetryPreparation
public abstract RetryPreparationDecision shouldRetryPreparation (ModuleDefinition module, int attempt, int maxAttempt)
确定是否应重试模块准备。
| 参数 | |
|---|---|
module |
ModuleDefinition |
attempt |
int |
maxAttempt |
int |
| 返回 | |
|---|---|
RetryPreparationDecision |
|
useUpdatedReporting
public abstract boolean useUpdatedReporting ()
如果应使用更新后的报告,则返回 true。
| 返回 | |
|---|---|
boolean |
|