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

Side by Side Diff: tools/testrunner/network/network_execution.py

Issue 273613005: Run tests sorted by expected runtime. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/testrunner/local/perfdata.py ('k') | tools/testrunner/network/perfdata.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2012 the V8 project authors. All rights reserved. 1 # Copyright 2012 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 15 matching lines...) Expand all
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 28
29 import os 29 import os
30 import socket 30 import socket
31 import subprocess 31 import subprocess
32 import threading 32 import threading
33 import time 33 import time
34 34
35 from . import distro 35 from . import distro
36 from . import perfdata
37 from ..local import execution 36 from ..local import execution
37 from ..local import perfdata
38 from ..objects import peer 38 from ..objects import peer
39 from ..objects import workpacket 39 from ..objects import workpacket
40 from ..server import compression 40 from ..server import compression
41 from ..server import constants 41 from ..server import constants
42 from ..server import local_handler 42 from ..server import local_handler
43 from ..server import signatures 43 from ..server import signatures
44 44
45 45
46 def GetPeers(): 46 def GetPeers():
47 data = local_handler.LocalQuery([constants.REQUEST_PEERS]) 47 data = local_handler.LocalQuery([constants.REQUEST_PEERS])
48 if not data: return [] 48 if not data: return []
49 return [ peer.Peer.Unpack(p) for p in data ] 49 return [ peer.Peer.Unpack(p) for p in data ]
50 50
51 51
52 class NetworkedRunner(execution.Runner): 52 class NetworkedRunner(execution.Runner):
53 def __init__(self, suites, progress_indicator, context, peers, workspace): 53 def __init__(self, suites, progress_indicator, context, peers, workspace):
54 self.suites = suites 54 self.suites = suites
55 num_tests = 0 55 num_tests = 0
56 datapath = os.path.join("out", "testrunner_data") 56 datapath = os.path.join("out", "testrunner_data")
57 # TODO(machenbach): These fields should exist now in the superclass.
58 # But there is no super constructor call. Check if this is a problem.
57 self.perf_data_manager = perfdata.PerfDataManager(datapath) 59 self.perf_data_manager = perfdata.PerfDataManager(datapath)
58 self.perfdata = self.perf_data_manager.GetStore(context.arch, context.mode) 60 self.perfdata = self.perf_data_manager.GetStore(context.arch, context.mode)
59 for s in suites: 61 for s in suites:
60 for t in s.tests: 62 for t in s.tests:
61 t.duration = self.perfdata.FetchPerfData(t) or 1.0 63 t.duration = self.perfdata.FetchPerfData(t) or 1.0
62 num_tests += len(s.tests) 64 num_tests += len(s.tests)
63 self._CommonInit(num_tests, progress_indicator, context) 65 self._CommonInit(num_tests, progress_indicator, context)
64 self.tests = [] # Only used if we need to fall back to local execution. 66 self.tests = [] # Only used if we need to fall back to local execution.
65 self.tests_lock = threading.Lock() 67 self.tests_lock = threading.Lock()
66 self.peers = peers 68 self.peers = peers
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 total_work += p.assigned_work 247 total_work += p.assigned_work
246 for p in self.peers: 248 for p in self.peers:
247 p.assigned_work /= total_work 249 p.assigned_work /= total_work
248 p.runtime /= total_runtime 250 p.runtime /= total_runtime
249 perf_correction = p.assigned_work / p.runtime 251 perf_correction = p.assigned_work / p.runtime
250 old_perf = p.relative_performance 252 old_perf = p.relative_performance
251 p.relative_performance = (old_perf + perf_correction) / 2.0 253 p.relative_performance = (old_perf + perf_correction) / 2.0
252 compression.Send([constants.UPDATE_PERF, p.address, 254 compression.Send([constants.UPDATE_PERF, p.address,
253 p.relative_performance], 255 p.relative_performance],
254 self.local_socket) 256 self.local_socket)
OLDNEW
« no previous file with comments | « tools/testrunner/local/perfdata.py ('k') | tools/testrunner/network/perfdata.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698