基本重試決策
public class BaseRetryDecision
extends Object
implements IRetryDecision , IConfigurationReceiver , ITestInformationReceiver
java.lang.Object |
↳ | com.android.tradefed.retry.BaseRetryDecision |
IRetryDecision
的基本實作。基本實作僅考慮本地訊號。
概括
公共方法 |
---|
void | addLastAttempt ( lastResults) addLastAttempt ( lastResults) ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List)) 很可能會在最後一次重試嘗試之前被調用,因此出於統計目的,我們可能會丟失最後一次嘗試的結果。 |
void | addToSkipRetryList (String filterEntry) 新增一個條目以跳過重試。 |
static | getFailedTestCases ( previousResults) getFailedTestCases ( previousResults) 傳回應重試的失敗測試案例的對應。 |
CurrentInvocation.IsolationGrade | getIsolationGrade () |
int | getMaxRetryCount () 自動重試期間的最大嘗試次數。 |
RetryStatistics | getRetryStatistics () 傳回表示重試的RetryStatistics 。 |
RetryStrategy | getRetryStrategy () 自動重試期間使用的RetryStrategy 。 |
| getSkipRetrySet () |
TestInformation | getTestInformation () |
boolean | isAutoRetryEnabled () 是否啟用自動重試。 |
boolean | rebootAtLastAttempt () 是否在最後一次嘗試之前重新啟動裝置。 |
void | setConfiguration ( IConfiguration configuration) 注入正在使用的IConfiguration 。 |
void | setInvocationContext ( IInvocationContext context) 設定當前呼叫上下文。 |
void | setTestInformation ( TestInformation testInformation) |
boolean | shouldRetry ( IRemoteTest test, ModuleDefinition module, int attemptJustExecuted, previousResults, DeviceNotAvailableException dnae) shouldRetry ( IRemoteTest test, ModuleDefinition module, int attemptJustExecuted, previousResults, DeviceNotAvailableException dnae) 決定是否應嘗試重試。 |
boolean | shouldRetry ( IRemoteTest test, int attemptJustExecuted, previousResults) shouldRetry ( IRemoteTest test, int attemptJustExecuted, previousResults) 決定是否應嘗試重試。 |
RetryPreparationDecision | shouldRetryPreparation ( ModuleDefinition module, int attempt, int maxAttempt) 決定是否應重試模組準備。 |
boolean | useUpdatedReporting () 如果我們應該使用更新的報告,則傳回 true。 |
公共構造函數
基本重試決策
public BaseRetryDecision ()
重試決策的建構函數
公共方法
新增跳過重試列表
public void addToSkipRetryList (String filterEntry)
新增一個條目以跳過重試。
取得失敗的測試案例
public static getFailedTestCases ( previousResults)
傳回應重試的失敗測試案例的對應。
取得最大重試次數
public int getMaxRetryCount ()
自動重試期間的最大嘗試次數。
取得跳過重試集
public getSkipRetrySet ()
是否啟用自動重試
public boolean isAutoRetryEnabled ()
是否啟用自動重試。
最後一次嘗試重新啟動
public boolean rebootAtLastAttempt ()
是否在最後一次嘗試之前重新啟動裝置。
設定呼叫上下文
public void setInvocationContext (IInvocationContext context)
設定當前呼叫上下文。
參數 |
---|
context | IInvocationContext |
public void setTestInformation (TestInformation testInformation)
參數 |
---|
testInformation | TestInformation |
應該重試
public boolean shouldRetry (IRemoteTest test,
int attemptJustExecuted,
previousResults)
決定是否應嘗試重試。也要對要重試的IRemoteTest
進行任何必要的更改(應用過濾器等)。
退貨 |
---|
boolean | 如果我們應該重試,則為 True,否則為 False。 |
使用更新報告
public boolean useUpdatedReporting ()
如果我們應該使用更新的報告,則傳回 true。
受保護的方法
隔離重試
protected void isolateRetry ( devices)