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

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

Issue 11013007: Test runner: Send SVN revision instead of git commit hash in work packet (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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 | « no previous file | tools/testrunner/server/work_handler.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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 for t in s.tests: 60 for t in s.tests:
61 t.duration = self.perfdata.FetchPerfData(t) or 1.0 61 t.duration = self.perfdata.FetchPerfData(t) or 1.0
62 num_tests += len(s.tests) 62 num_tests += len(s.tests)
63 self._CommonInit(num_tests, progress_indicator, context) 63 self._CommonInit(num_tests, progress_indicator, context)
64 self.tests = [] # Only used if we need to fall back to local execution. 64 self.tests = [] # Only used if we need to fall back to local execution.
65 self.tests_lock = threading.Lock() 65 self.tests_lock = threading.Lock()
66 self.peers = peers 66 self.peers = peers
67 self.pubkey_fingerprint = None # Fetched later. 67 self.pubkey_fingerprint = None # Fetched later.
68 self.base_rev = subprocess.check_output( 68 self.base_rev = subprocess.check_output(
69 "cd %s; git log -1 --format=%%H --grep=git-svn-id" % workspace, 69 "cd %s; git log -1 --format=%%H --grep=git-svn-id" % workspace,
70 shell=True) 70 shell=True).strip()
71 self.base_svn_rev = subprocess.check_output(
72 "cd %s; git log -1 %s" # Get commit description.
73 " | grep -e '^\s*git-svn-id:'" # Extract "git-svn-id" line.
74 " | awk '{print $2}'" # Extract "repository@revision" part.
75 " | sed -e 's/.*@//'" % # Strip away "repository@".
Michael Starzinger 2012/10/01 08:59:22 You could indent the more to match it up with the
Jakob Kummerow 2012/10/01 09:05:08 Done.
76 (workspace, self.base_rev), shell=True).strip()
71 self.patch = subprocess.check_output( 77 self.patch = subprocess.check_output(
72 "cd %s; git diff %s" % (workspace, self.base_rev), shell=True) 78 "cd %s; git diff %s" % (workspace, self.base_rev), shell=True)
73 self.binaries = {} 79 self.binaries = {}
74 self.initialization_lock = threading.Lock() 80 self.initialization_lock = threading.Lock()
75 self.initialization_lock.acquire() # Released when init is done. 81 self.initialization_lock.acquire() # Released when init is done.
76 self._OpenLocalConnection() 82 self._OpenLocalConnection()
77 self.local_receiver_thread = threading.Thread( 83 self.local_receiver_thread = threading.Thread(
78 target=self._ListenLocalConnection) 84 target=self._ListenLocalConnection)
79 self.local_receiver_thread.daemon = True 85 self.local_receiver_thread.daemon = True
80 self.local_receiver_thread.start() 86 self.local_receiver_thread.start()
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 167
162 def _TalkToPeer(self, peer): 168 def _TalkToPeer(self, peer):
163 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 169 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
164 sock.settimeout(self.context.timeout + 10) 170 sock.settimeout(self.context.timeout + 10)
165 code = sock.connect_ex((peer.address, constants.PEER_PORT)) 171 code = sock.connect_ex((peer.address, constants.PEER_PORT))
166 if code == 0: 172 if code == 0:
167 try: 173 try:
168 peer.runtime = None 174 peer.runtime = None
169 start_time = time.time() 175 start_time = time.time()
170 packet = workpacket.WorkPacket(peer=peer, context=self.context, 176 packet = workpacket.WorkPacket(peer=peer, context=self.context,
171 base_revision=self.base_rev, 177 base_revision=self.base_svn_rev,
172 patch=self.patch, 178 patch=self.patch,
173 pubkey=self.pubkey_fingerprint) 179 pubkey=self.pubkey_fingerprint)
174 data, test_map = packet.Pack(self.binaries) 180 data, test_map = packet.Pack(self.binaries)
175 compression.Send(data, sock) 181 compression.Send(data, sock)
176 compression.Send(constants.END_OF_STREAM, sock) 182 compression.Send(constants.END_OF_STREAM, sock)
177 rec = compression.Receiver(sock) 183 rec = compression.Receiver(sock)
178 while not rec.IsDone() and not self.terminate: 184 while not rec.IsDone() and not self.terminate:
179 data_list = rec.Current() 185 data_list = rec.Current()
180 for data in data_list: 186 for data in data_list:
181 test_id = data[0] 187 test_id = data[0]
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 total_work += p.assigned_work 240 total_work += p.assigned_work
235 for p in self.peers: 241 for p in self.peers:
236 p.assigned_work /= total_work 242 p.assigned_work /= total_work
237 p.runtime /= total_runtime 243 p.runtime /= total_runtime
238 perf_correction = p.assigned_work / p.runtime 244 perf_correction = p.assigned_work / p.runtime
239 old_perf = p.relative_performance 245 old_perf = p.relative_performance
240 p.relative_performance = (old_perf + perf_correction) / 2.0 246 p.relative_performance = (old_perf + perf_correction) / 2.0
241 compression.Send([constants.UPDATE_PERF, p.address, 247 compression.Send([constants.UPDATE_PERF, p.address,
242 p.relative_performance], 248 p.relative_performance],
243 self.local_socket) 249 self.local_socket)
OLDNEW
« no previous file with comments | « no previous file | tools/testrunner/server/work_handler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698