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

Unified Diff: build/android/pylib/perf/test_runner.py

Issue 1148873007: Fix last_devices to be quieter, and improve device affinity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sort devices again for reboot-stability Created 5 years, 6 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 | « build/android/pylib/perf/setup.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/perf/test_runner.py
diff --git a/build/android/pylib/perf/test_runner.py b/build/android/pylib/perf/test_runner.py
index 0f464c3cdce2ede3ad14f104fcc8e9b10de20643..a9a978f2a5047aed351a8e934ef1f75772edaabf 100644
--- a/build/android/pylib/perf/test_runner.py
+++ b/build/android/pylib/perf/test_runner.py
@@ -66,6 +66,8 @@ from pylib.base import base_test_runner
from pylib.device import battery_utils
from pylib.device import device_errors
+NUM_DEVICE_AFFINITIES = 8
+
def GetPersistedResult(test_name):
file_name = os.path.join(constants.PERF_OUTPUT_DIR, test_name)
@@ -173,22 +175,19 @@ class _HeartBeatLogger(object):
class TestRunner(base_test_runner.BaseTestRunner):
- def __init__(self, test_options, device, shard_index, max_shard, tests,
- flaky_tests):
+ def __init__(self, test_options, device, affinities, tests, flaky_tests):
"""A TestRunner instance runs a perf test on a single device.
Args:
test_options: A PerfOptions object.
device: Device to run the tests.
- shard_index: the index of this device.
- max_shards: the maximum shard index.
+ affinities: the list of affinities to run on this shard.
tests: a dict mapping test_name to command.
flaky_tests: a list of flaky test_name.
"""
super(TestRunner, self).__init__(device, None)
self._options = test_options
- self._shard_index = shard_index
- self._max_shard = max_shard
+ self._affinities = affinities
self._tests = tests
self._flaky_tests = flaky_tests
self._output_dir = None
@@ -215,12 +214,14 @@ class TestRunner(base_test_runner.BaseTestRunner):
def _CheckDeviceAffinity(self, test_name):
"""Returns True if test_name has affinity for this shard."""
- affinity = (self._tests['steps'][test_name]['device_affinity'] %
- self._max_shard)
- if self._shard_index == affinity:
+ affinity = self._tests['steps'][test_name]['device_affinity']
+ if not (0 <= affinity and affinity < NUM_DEVICE_AFFINITIES):
+ raise Exception('Got out-of-range device affinity %s' % affinity)
+ if affinity in self._affinities:
return True
- logging.info('Skipping %s on %s (affinity is %s, device is %s)',
- test_name, self.device_serial, affinity, self._shard_index)
+ logging.info(
+ 'Skipping %s on %s (affinity is %s, allowed affinities are %s)',
+ test_name, self.device_serial, affinity, self._affinities)
return False
def _CleanupOutputDirectory(self):
« no previous file with comments | « build/android/pylib/perf/setup.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698