BaseRetryDecision
public
class
BaseRetryDecision
extends Object
implements
IRetryDecision,
IConfigurationReceiver
java.lang.Object | |
↳ | com.android.tradefed.retry.BaseRetryDecision |
IRetryDecision
的基本实现。基本实现仅考虑本地信号。
摘要
公共构造函数 | |
---|---|
BaseRetryDecision()
重试决策的构造函数 |
公共方法 | |
---|---|
void
|
addLastAttempt(
|
static
|
getFailedTestCases(
返回应重试的失败测试用例的映射。 |
CurrentInvocation.IsolationGrade
|
getIsolationGrade()
|
int
|
getMaxRetryCount()
自动重试期间的尝试次数上限。 |
RetryStatistics
|
getRetryStatistics()
返回表示重试的 |
RetryStrategy
|
getRetryStrategy()
自动重试期间使用的 |
boolean
|
isAutoRetryEnabled()
是否启用自动重试。 |
boolean
|
rebootAtLastAttempt()
在最后一次尝试之前是否重启设备。 |
void
|
setConfiguration(IConfiguration configuration)
注入正在使用的 |
void
|
setInvocationContext(IInvocationContext context)
设置当前调用上下文。 |
boolean
|
shouldRetry(IRemoteTest test, int attemptJustExecuted,
决定是否应尝试重试。 |
boolean
|
shouldRetry(IRemoteTest test, ModuleDefinition module, int attemptJustExecuted,
决定是否应尝试重试。 |
boolean
|
useUpdatedReporting()
如果应使用更新后的报告,则返回 true。 |
受保护的方法 | |
---|---|
void
|
isolateRetry(
|
公共构造函数
BaseRetryDecision
public BaseRetryDecision ()
重试决策的构造函数
公共方法
addLastAttempt
public void addLastAttempt (lastResults)
ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List))
很可能会在最后一次重试之前调用,因此我们可能会错过统计目的的最后一次尝试结果。通过这种方法,系统可以提供这些结果,以便进行适当的统计计算。
getFailedTestCases
public staticgetFailedTestCases ( previousResults)
返回应重试的失败测试用例的映射。
参数 | |
---|---|
previousResults |
|
返回 | |
---|---|
|
getIsolationGrade
public CurrentInvocation.IsolationGrade getIsolationGrade ()
返回 | |
---|---|
CurrentInvocation.IsolationGrade |
getMaxRetryCount
public int getMaxRetryCount ()
自动重试期间的尝试次数上限。
返回 | |
---|---|
int |
getRetryStatistics
public RetryStatistics getRetryStatistics ()
返回表示重试的 RetryStatistics
。
返回 | |
---|---|
RetryStatistics |
isAutoRetryEnabled
public boolean isAutoRetryEnabled ()
是否启用自动重试。
返回 | |
---|---|
boolean |
rebootAtLastAttempt
public boolean rebootAtLastAttempt ()
在最后一次尝试之前是否重启设备。
返回 | |
---|---|
boolean |
setConfiguration
public void setConfiguration (IConfiguration configuration)
注入正在使用的 IConfiguration
。
参数 | |
---|---|
configuration |
IConfiguration |
setInvocationContext
public void setInvocationContext (IInvocationContext context)
设置当前调用上下文。
参数 | |
---|---|
context |
IInvocationContext |
shouldRetry
public boolean shouldRetry (IRemoteTest test, int attemptJustExecuted,previousResults)
决定是否应尝试重试。此外,请对要重试的 IRemoteTest
进行必要的更改(应用过滤条件等)。
参数 | |
---|---|
test |
IRemoteTest :刚刚运行的 IRemoteTest 。 |
attemptJustExecuted |
int :我们刚刚运行的尝试次数。 |
previousResults |
:刚刚运行的测试的 TestRunResult 列表。 |
返回 | |
---|---|
boolean |
如果应重试,则返回 True;否则返回 False。 |
抛出 | |
---|---|
DeviceNotAvailableException |
shouldRetry
public boolean shouldRetry (IRemoteTest test, ModuleDefinition module, int attemptJustExecuted,previousResults)
决定是否应尝试重试。此外,请对要重试的 IRemoteTest
进行必要的更改(应用过滤条件等)。
参数 | |
---|---|
test |
IRemoteTest :刚刚运行的 IRemoteTest 。 |
module |
ModuleDefinition :测试模块的 ModuleDefinition 对象。 |
attemptJustExecuted |
int :我们刚刚运行的尝试次数。 |
previousResults |
:刚刚运行的测试的 TestRunResult 列表。 |
返回 | |
---|---|
boolean |
如果应重试,则返回 True;否则返回 False。 |
抛出 | |
---|---|
DeviceNotAvailableException |
useUpdatedReporting
public boolean useUpdatedReporting ()
如果应使用更新后的报告,则返回 true。
返回 | |
---|---|
boolean |
受保护的方法
isolateRetry
protected void isolateRetry (devices)
参数 | |
---|---|
devices |
|
抛出 | |
---|---|
DeviceNotAvailableException |