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 | 可以在設備恢復期間拋出 |