重試決定

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

決定是否應該嘗試重試。

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

getRetryStatistics

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 RetryPreparationDecision shouldRetryPreparation (ModuleDefinition module, 
                int attempt, 
                int maxAttempt)

決定是否應該重試模塊準備。

參數
module ModuleDefinition

attempt int

maxAttempt int

退貨
RetryPreparationDecision

使用更新報告

public abstract boolean useUpdatedReporting ()

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

退貨
boolean