Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Unified Diff: build/android/pylib/local/device/local_device_gtest_run.py

Issue 1363643002: [Android] Fix miscellaneous small issues with gtest platform mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nanos being handled as a float & being converted to "9+e11" Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/pylib/local/device/local_device_test_run.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/local/device/local_device_gtest_run.py
diff --git a/build/android/pylib/local/device/local_device_gtest_run.py b/build/android/pylib/local/device/local_device_gtest_run.py
index a8452600791a8c08d80b7af19713bd76d3b0a6b0..eb2151305ac66e8cc74c3b440e68e177cc0e51c2 100644
--- a/build/android/pylib/local/device/local_device_gtest_run.py
+++ b/build/android/pylib/local/device/local_device_gtest_run.py
@@ -21,11 +21,15 @@ _EXTRA_COMMAND_LINE_FILE = (
'org.chromium.native_test.NativeTestActivity.CommandLineFile')
_EXTRA_COMMAND_LINE_FLAGS = (
'org.chromium.native_test.NativeTestActivity.CommandLineFlags')
+_EXTRA_SHARD_NANO_TIMEOUT = (
+ 'org.chromium.native_test.NativeTestInstrumentationTestRunner'
+ '.ShardNanoTimeout')
_EXTRA_TEST_LIST = (
'org.chromium.native_test.NativeTestInstrumentationTestRunner'
'.TestList')
_MAX_SHARD_SIZE = 256
+_SECONDS_TO_NANOS = int(1e9)
# TODO(jbudorick): Move this up to the test instance if the net test server is
# handled outside of the APK for the remote_device environment.
@@ -65,6 +69,14 @@ class _ApkDelegate(object):
def Run(self, test, device, flags=None, **kwargs):
extras = dict(self._extras)
+ if 'timeout' in kwargs:
+ # Make sure the instrumentation doesn't kill the test before the
+ # scripts do. The provided timeout value is in seconds, but the
+ # instrumentation deals with nanoseconds because that's how Android
+ # handles time.
+ timeout = int(kwargs['timeout'] * _SECONDS_TO_NANOS)
rnephew (Wrong account) 2015/09/22 23:00:04 Any reason this cant just be extras[_EXTRA_SHARD_
jbudorick 2015/09/22 23:37:47 having a separate variable was left over from some
+ extras[_EXTRA_SHARD_NANO_TIMEOUT] = timeout
+
with device_temp_file.DeviceTempFile(device.adb) as command_line_file:
device.WriteFile(command_line_file.name, '_ %s' % flags if flags else '_')
extras[_EXTRA_COMMAND_LINE_FILE] = command_line_file.name
@@ -219,7 +231,7 @@ class LocalDeviceGtestRun(local_device_test_run.LocalDeviceTestRun):
#override
def _RunTest(self, device, test):
# Run the test.
- timeout = 900 * self.GetTool(device).GetTimeoutScale()
+ timeout = 60 * self.GetTool(device).GetTimeoutScale()
output = self._delegate.Run(
test, device, timeout=timeout, retries=0)
for s in self._servers[str(device)]:
@@ -238,7 +250,7 @@ class LocalDeviceGtestRun(local_device_test_run.LocalDeviceTestRun):
def TearDown(self):
@local_device_test_run.handle_shard_failures
def individual_device_tear_down(dev):
- for s in self._servers[str(dev)]:
+ for s in self._servers.get(str(dev), []):
s.TearDown()
self._env.parallel_devices.pMap(individual_device_tear_down)
« no previous file with comments | « no previous file | build/android/pylib/local/device/local_device_test_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698