OLD | NEW |
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 datapath = os.path.join("out", "testrunner_data") | 56 datapath = os.path.join("out", "testrunner_data") |
56 # TODO(machenbach): These fields should exist now in the superclass. | 57 # TODO(machenbach): These fields should exist now in the superclass. |
57 # But there is no super constructor call. Check if this is a problem. | 58 # But there is no super constructor call. Check if this is a problem. |
58 self.perf_data_manager = perfdata.PerfDataManager(datapath) | 59 self.perf_data_manager = perfdata.PerfDataManager(datapath) |
59 self.perfdata = self.perf_data_manager.GetStore(context.arch, context.mode) | 60 self.perfdata = self.perf_data_manager.GetStore(context.arch, context.mode) |
60 for s in suites: | 61 for s in suites: |
61 for t in s.tests: | 62 for t in s.tests: |
62 t.duration = self.perfdata.FetchPerfData(t) or 1.0 | 63 t.duration = self.perfdata.FetchPerfData(t) or 1.0 |
63 self._CommonInit(suites, progress_indicator, context) | 64 num_tests += len(s.tests) |
| 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 |
67 self.pubkey_fingerprint = None # Fetched later. | 69 self.pubkey_fingerprint = None # Fetched later. |
68 self.base_rev = subprocess.check_output( | 70 self.base_rev = subprocess.check_output( |
69 "cd %s; git log -1 --format=%%H --grep=git-svn-id" % workspace, | 71 "cd %s; git log -1 --format=%%H --grep=git-svn-id" % workspace, |
70 shell=True).strip() | 72 shell=True).strip() |
71 self.base_svn_rev = subprocess.check_output( | 73 self.base_svn_rev = subprocess.check_output( |
72 "cd %s; git log -1 %s" # Get commit description. | 74 "cd %s; git log -1 %s" # Get commit description. |
73 " | grep -e '^\s*git-svn-id:'" # Extract "git-svn-id" line. | 75 " | grep -e '^\s*git-svn-id:'" # Extract "git-svn-id" line. |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) |
OLD | NEW |