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

Side by Side Diff: tools/isolate/worker_pool.py

Issue 10533085: Add a unit test for run_test_cases.py. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """Implements a multithreaded worker pool oriented for mapping jobs with 5 """Implements a multithreaded worker pool oriented for mapping jobs with
6 thread-local result storage. 6 thread-local result storage.
7 """ 7 """
8 8
9 import Queue 9 import Queue
10 import sys 10 import sys
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 def print_update(self): 130 def print_update(self):
131 """Prints the current status.""" 131 """Prints the current status."""
132 with self.lock: 132 with self.lock:
133 if self.next_line == self.last_printed_line: 133 if self.next_line == self.last_printed_line:
134 return 134 return
135 line = '\r%s%s' % ( 135 line = '\r%s%s' % (
136 self.next_line, 136 self.next_line,
137 ' ' * max(0, len(self.last_printed_line) - len(self.next_line))) 137 ' ' * max(0, len(self.last_printed_line) - len(self.next_line)))
138 self.last_printed_line = self.next_line 138 self.last_printed_line = self.next_line
139 sys.stdout.write(line) 139 sys.stderr.write(line)
140 sys.stdout.flush()
141 140
142 def increase_count(self): 141 def increase_count(self):
143 with self.lock: 142 with self.lock:
144 self.size += 1 143 self.size += 1
OLDNEW
« tools/isolate/run_test_cases_test.py ('K') | « tools/isolate/run_test_cases_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698