重試決定

public interface IRetryDecision

com.android.tradefed.retry.IRetryDecision


接口驅動重試決策並在類上應用過濾器以獲得更有針對性的重試。

概括

公共方法

abstract void addLastAttempt ( lastResults) addLastAttempt ( lastResults)

ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List))將最有可能在最後一個試嘗試之前調用,所以我們可能會丟失統計目的的最後嘗試的結果。

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

決定是否應該嘗試重試。

abstract boolean useUpdatedReporting ()

如果我們應該使用更新的報告,則返回 true。

公共方法

添加最後一次嘗試

public abstract void addLastAttempt ( lastResults)

ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List))將最有可能在最後一個試嘗試之前調用,所以我們可能會丟失統計目的的最後嘗試的結果。該方法允許為適當的統計計算提供這些結果。

獲取最大重試計數

public abstract int getMaxRetryCount ()

自動重試期間的最大嘗試次數。

退貨
int

獲取重試統計信息

public abstract RetryStatistics getRetryStatistics ()

返回RetryStatistics代表重試。

退貨
RetryStatistics

獲取重試策略

public abstract RetryStrategy getRetryStrategy ()

RetryStrategy自動重試時使用。

退貨
RetryStrategy

isAutoRetryEnabled

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)

決定是否應該嘗試重試。另外,還要在必要的修改IRemoteTest重試(應用過濾器等)。

參數
test IRemoteTest :該IRemoteTest剛剛跑了。

module ModuleDefinition :該ModuleDefinition對象的測試模塊。

attemptJustExecuted int :嘗試的,我們只是跑的次數。

previousResults :列表TestRunResult測試,只是跑去。

退貨
boolean如果我們應該重試,則為 True,否則為 False。

投擲
DeviceNotAvailableException可以在設備恢復期間拋出

使用更新報告

public abstract boolean useUpdatedReporting ()

如果我們應該使用更新的報告,則返回 true。

退貨
boolean