IRetryDecision

public interface IRetryDecision

com.android.tradefed.retry.IRetryDecision


介面會決定是否重試,並在類別上套用篩選器,以便更精準地重試。

摘要

公用方法

abstract void addLastAttempt(List<TestRunResult> lastResults)

shouldRetry(IRemoteTest,int,List) 最有可能在最後一次重試嘗試之前呼叫,因此我們可能會遺漏最後一次嘗試的結果,以供統計用途。

default void addToSkipRetryList(String filterEntry)

新增項目即可略過重試。

abstract List<String> getCommandLineArgs()

傳回重試決策的指令列引數。

abstract int getMaxTestCaseAttempts()

自動重試時,每次測試執行的嘗試次數上限。

abstract int getMaxTestCaseAttempts(ModuleDefinition module)

自動重試期間,特定模組每次測試執行的嘗試次數上限。

abstract int getMaxTestRunAttempts()

自動重試時,每次測試執行的嘗試次數上限。

abstract int getMaxTestRunAttempts(ModuleDefinition module)

自動重試期間,特定模組每次測試執行的嘗試次數上限。

abstract RetryStatistics getRetryStatistics()

傳回代表重試的 RetryStatistics

abstract RetryStrategy getRetryStrategy()

自動重試期間使用的 RetryStrategy

abstract boolean isAutoRetryEnabled()

是否啟用自動重試。

abstract boolean rebootAtLastAttempt()

是否要在最後一次嘗試前重新啟動裝置。

abstract void setInvocationContext(IInvocationContext context)

Set the current invocation context.

abstract boolean shouldRetry(IRemoteTest test, ModuleDefinition module, int attemptJustExecuted, List<TestRunResult> previousResults, DeviceNotAvailableException dnae)

決定是否要嘗試重試。

abstract boolean shouldRetry(IRemoteTest test, int attemptJustExecuted, List<TestRunResult> previousResults)

決定是否應嘗試重試。

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

決定是否要重試模組準備作業。

abstract boolean useUpdatedReporting()

Returns true if we should use the updated reporting.

公用方法

addLastAttempt

public abstract void addLastAttempt (List<TestRunResult> lastResults)

shouldRetry(IRemoteTest,int,List) 最有可能在最後一次重試嘗試之前呼叫,因此我們可能會為了統計目的而遺漏最後一次嘗試的結果。這個方法可提供這些結果,以利進行適當的統計資料計算。

addToSkipRetryList

public void addToSkipRetryList (String filterEntry)

新增項目即可略過重試。

參數
filterEntry String

getCommandLineArgs

public abstract List<String> getCommandLineArgs ()

傳回重試決策的指令列引數。

傳回
List<String>

getMaxTestCaseAttempts

public abstract int getMaxTestCaseAttempts ()

自動重試時,每次測試執行的嘗試次數上限。

傳回
int

getMaxTestCaseAttempts

public abstract int getMaxTestCaseAttempts (ModuleDefinition module)

自動重試期間,特定模組每次測試執行的嘗試次數上限。

參數
module ModuleDefinition

傳回
int

getMaxTestRunAttempts

public abstract int getMaxTestRunAttempts ()

自動重試時,每次測試執行的嘗試次數上限。

傳回
int

getMaxTestRunAttempts

public abstract int getMaxTestRunAttempts (ModuleDefinition module)

自動重試期間,特定模組每次測試執行的嘗試次數上限。

參數
module ModuleDefinition

傳回
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

shouldRetry

public abstract boolean shouldRetry (IRemoteTest test, 
                ModuleDefinition module, 
                int attemptJustExecuted, 
                List<TestRunResult> previousResults, 
                DeviceNotAvailableException dnae)

決定是否要嘗試重試。此外,請對 IRemoteTest 進行必要變更,然後重試 (套用篩選器等)。

參數
test IRemoteTest:剛執行的 IRemoteTest

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

attemptJustExecuted int:我們剛執行的嘗試次數。

previousResults List:剛執行的測試 TestRunResult 清單。

dnae DeviceNotAvailableException:裝置無法使用例外狀況。DeviceNotAvailableException

傳回
boolean 如果應重試,則為 True,否則為 False。

擲回
DeviceNotAvailableException 裝置復原期間可能會擲回

shouldRetry

public abstract boolean shouldRetry (IRemoteTest test, 
                int attemptJustExecuted, 
                List<TestRunResult> previousResults)

決定是否要嘗試重試。此外,請對 IRemoteTest 進行必要變更,然後重試 (套用篩選器等)。

參數
test IRemoteTest:剛執行的 IRemoteTest

attemptJustExecuted int:我們剛執行的嘗試次數。

previousResults List:剛執行的測試 TestRunResult 清單。

傳回
boolean 如果應重試,則為 True,否則為 False。

擲回
DeviceNotAvailableException 裝置復原期間可能會擲回

shouldRetryPreparation

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

決定是否要重試模組準備作業。

參數
module ModuleDefinition

attempt int

maxAttempt int

傳回
RetryPreparationDecision

useUpdatedReporting

public abstract boolean useUpdatedReporting ()

如果應使用更新版報表,則傳回 true。

傳回
boolean