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

Side by Side Diff: build/android/pylib/local/device/local_device_perf_test_run.py

Issue 2486993003: [Android] Make android test runner run perf tests in alphabetical order. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import collections
5 import io 6 import io
6 import json 7 import json
7 import logging 8 import logging
8 import os 9 import os
9 import pickle 10 import pickle
10 import shutil 11 import shutil
11 import tempfile 12 import tempfile
12 import threading 13 import threading
13 import time 14 import time
14 import zipfile 15 import zipfile
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 steps['version'])) 364 steps['version']))
364 return steps 365 return steps
365 raise PerfTestRunGetStepsError( 366 raise PerfTestRunGetStepsError(
366 'Neither single_step or steps set in test_instance.') 367 'Neither single_step or steps set in test_instance.')
367 368
368 def _SplitTestsByAffinity(self): 369 def _SplitTestsByAffinity(self):
369 # This splits tests by their device affinity so that the same tests always 370 # This splits tests by their device affinity so that the same tests always
370 # run on the same devices. This is important for perf tests since different 371 # run on the same devices. This is important for perf tests since different
371 # devices might yield slightly different performance results. 372 # devices might yield slightly different performance results.
372 test_dict = self._GetStepsFromDict() 373 test_dict = self._GetStepsFromDict()
373 for test, test_config in test_dict['steps'].iteritems(): 374 for test, test_config in sorted(test_dict['steps'].iteritems()):
374 try: 375 try:
375 affinity = test_config.get('device_affinity') 376 affinity = test_config.get('device_affinity')
376 if affinity is None: 377 if affinity is None:
377 self._no_device_tests[test] = test_config 378 self._no_device_tests[test] = test_config
378 else: 379 else:
379 if len(self._test_buckets) < affinity + 1: 380 if len(self._test_buckets) < affinity + 1:
380 while len(self._test_buckets) != affinity + 1: 381 while len(self._test_buckets) != affinity + 1:
381 self._test_buckets.append({}) 382 self._test_buckets.append(collections.OrderedDict())
382 self._test_buckets[affinity][test] = test_config 383 self._test_buckets[affinity][test] = test_config
383 except KeyError: 384 except KeyError:
384 logging.exception( 385 logging.exception(
385 'Test config for %s is bad.\n Config:%s', test, str(test_config)) 386 'Test config for %s is bad.\n Config:%s', test, str(test_config))
386 387
387 @staticmethod 388 @staticmethod
388 def _GetAllDevices(active_devices, devices_path): 389 def _GetAllDevices(active_devices, devices_path):
389 try: 390 try:
390 if devices_path: 391 if devices_path:
391 devices = [device_utils.DeviceUtils(s) 392 devices = [device_utils.DeviceUtils(s)
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 # override 509 # override
509 def _RunTest(self, _device, _test): 510 def _RunTest(self, _device, _test):
510 raise NotImplementedError 511 raise NotImplementedError
511 512
512 513
513 class TestDictVersionError(Exception): 514 class TestDictVersionError(Exception):
514 pass 515 pass
515 516
516 class PerfTestRunGetStepsError(Exception): 517 class PerfTestRunGetStepsError(Exception):
517 pass 518 pass
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698