I重試決策

public interface IRetryDecision

com.android.tradefed.retry.IRetryDecision


介面驅動重試決策並在類別上套用篩選器以實現更有針對性的重試。

概括

公共方法

abstract void addLastAttempt ( lastResults) addLastAttempt ( lastResults)

ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List))很可能會在最後一次重試嘗試之前被調用,因此出於統計目的,我們可能會丟失最後一次嘗試的結果。

default void addToSkipRetryList (String filterEntry)

新增一個條目以跳過重試。

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

決定是否應嘗試重試。

abstract RetryPreparationDecision shouldRetryPreparation ( ModuleDefinition module, int attempt, int maxAttempt)

決定是否應重試模組準備。

abstract boolean useUpdatedReporting ()

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

公共方法

添加最後一次嘗試

public abstract void addLastAttempt ( lastResults)

ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List))很可能會在最後一次重試嘗試之前被調用,因此出於統計目的,我們可能會丟失最後一次嘗試的結果。該方法允許提供這些結果以進行正確的統計計算。

新增跳過重試列表

public void addToSkipRetryList (String filterEntry)

新增一個條目以跳過重試。

參數
filterEntry String

取得最大重試次數

public abstract int getMaxRetryCount ()

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

退貨
int

獲取重試統計信息

public abstract RetryStatistics getRetryStatistics ()

傳回表示重試的RetryStatistics

退貨
RetryStatistics

取得重試策略

public abstract RetryStrategy getRetryStrategy ()

自動重試期間使用的RetryStrategy

退貨
RetryStrategy

是否啟用自動重試

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, 
                DeviceNotAvailableException dnae)

決定是否應嘗試重試。也要對要重試的IRemoteTest進行任何必要的更改(應用過濾器等)。

參數
test IRemoteTest :剛運行的IRemoteTest

module ModuleDefinition :測試模組的ModuleDefinition物件。

attemptJustExecuted int :我們剛剛運行的嘗試的編號。

previousResults :剛剛執行的測試的TestRunResult列表。

dnae DeviceNotAvailableException :裝置不可用例外的DeviceNotAvailableException

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

投擲
DeviceNotAvailableException設備恢復期間可能會拋出

應該重試準備

public abstract RetryPreparationDecision shouldRetryPreparation (ModuleDefinition module, 
                int attempt, 
                int maxAttempt)

決定是否應重試模組準備。

參數
module ModuleDefinition

attempt int

maxAttempt int

退貨
RetryPreparationDecision

使用更新報告

public abstract boolean useUpdatedReporting ()

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

退貨
boolean