IRetryDecision

public interface IRetryDecision

com.android.tradefed.retry.IRetryDecision


介面會引導重試決策,並在類別上套用篩選器,以便更有針對性地重試。

摘要

公用方法

abstract void 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)

決定是否應嘗試重試。

abstract boolean shouldRetry(IRemoteTest test, ModuleDefinition module, int attemptJustExecuted, previousResults)

決定是否應嘗試重試。

abstract boolean useUpdatedReporting()

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

公用方法

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

shouldRetry

public abstract boolean shouldRetry (IRemoteTest test, 
                int attemptJustExecuted, 
                 previousResults)

決定是否應重試。另外,請對要重試的 IRemoteTest 進行必要變更 (例如套用篩選器)。

參數
test IRemoteTest:剛執行的 IRemoteTest

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

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

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

擲回
DeviceNotAvailableException 可在裝置復原期間擲回

shouldRetry

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 可在裝置復原期間擲回

useUpdatedReporting

public abstract boolean useUpdatedReporting ()

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

傳回
boolean