RemoteTestTimeOutEnforcer

public class RemoteTestTimeOutEnforcer
extends Object implements ITestInvocationListener

java.lang.Object
   ↳ com.android.tradefed.testtype.suite.RemoteTestTimeOutEnforcer


Listeners that allows to check the execution time of a given test config and fail it if it goes over a given timeout.

Note that this enforcer doesn't interrupt the tests, but will make them fail.

Summary

Fields

public static final String REMOTE_TEST_TIMEOUT_DESCRIPTION

public static final String REMOTE_TEST_TIMEOUT_OPTION

Public constructors

RemoteTestTimeOutEnforcer(ModuleListener listener, ModuleDefinition moduleDefinition, IRemoteTest test, Duration timeOut)

Create the RemoteTestTimeOutEnforcer with the given timeout to enforce.

Public methods

void testRunEnded(long elapsedTime, runMetrics)

Reports end of test run.

Fields

REMOTE_TEST_TIMEOUT_DESCRIPTION

public static final String REMOTE_TEST_TIMEOUT_DESCRIPTION

REMOTE_TEST_TIMEOUT_OPTION

public static final String REMOTE_TEST_TIMEOUT_OPTION

Public constructors

RemoteTestTimeOutEnforcer

public RemoteTestTimeOutEnforcer (ModuleListener listener, 
                ModuleDefinition moduleDefinition, 
                IRemoteTest test, 
                Duration timeOut)

Create the RemoteTestTimeOutEnforcer with the given timeout to enforce.

Parameters
listener ModuleListener: The ModuleListener for each test run.

moduleDefinition ModuleDefinition: The ModuleDefinition of the test module to be executed.

test IRemoteTest: The IRemoteTest to be executed.

timeOut Duration: The ERROR(/Duration) of the time out per test run.

Public methods

testRunEnded

public void testRunEnded (long elapsedTime, 
                 runMetrics)

Reports end of test run. FIXME: We cannot have two Map<> interfaces with different type, so we have to use HashMap here.

Parameters
elapsedTime long: device reported elapsed time, in milliseconds

runMetrics : key-value pairs reported at the end of a test run with Metric.