Reviewed by Kenneth Russell.
Modify new-run-webkit-tests to shut up and exit when all the threads
are wedged so that test runs complete faster and we don't end up
w/ enormous log files.
https://bugs.webkit.org/show_bug.cgi?id=51572
* Scripts/webkitpy/layout_tests/layout_package/message_broker.py:
* Scripts/webkitpy/layout_tests/layout_package/message_broker_unittest.py:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74632
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2010-12-24 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Kenneth Russell.
+
+ Modify new-run-webkit-tests to shut up and exit when all the threads
+ are wedged so that test runs complete faster and we don't end up
+ w/ enormous log files.
+
+ https://bugs.webkit.org/show_bug.cgi?id=51572
+
+ * Scripts/webkitpy/layout_tests/layout_package/message_broker.py:
+ * Scripts/webkitpy/layout_tests/layout_package/message_broker_unittest.py:
+
2010-12-24 Eric Seidel <eric@webkit.org>
Reviewed by David Levin.
def run_message_loop(self):
threads = self._threads()
+ wedged_threads = set()
# Loop through all the threads waiting for them to finish.
some_thread_is_alive = True
raise exception_info[0], exception_info[1], exception_info[2]
if thread.isAlive():
+ if thread in wedged_threads:
+ continue
+
some_thread_is_alive = True
next_timeout = thread.next_timeout()
if next_timeout and t > next_timeout:
log_wedged_worker(thread.getName(), thread.id())
thread.clear_next_timeout()
+ wedged_threads.add(thread)
self._test_runner.update()
if some_thread_is_alive:
time.sleep(0.01)
+ if wedged_threads:
+ _log.warning("All remaining threads are wedged, bailing out.")
+
def cancel_workers(self):
threads = self._threads()
for thread in threads:
def next_timeout(self):
if self._timeout:
- self._timeout_queue.put('done')
return time.time() - 10
return time.time()
def test_exception(self):
self.assertRaises(ValueError, self.run_one_thread, 'Exception')
-
-class Test(unittest.TestCase):
def test_find_thread_stack_found(self):
id, stack = sys._current_frames().items()[0]
found_stack = message_broker._find_thread_stack(id)
child_thread.start()
msg = starting_queue.get()
- message_broker.log_wedged_worker(child_thread.getName(),
- child_thread.id())
- stopping_queue.put('')
+ # FIXME: this is an ugly hack to make the broker aware of the thread.
+ port = None
+ options = mocktool.MockOptions(child_processes='1')
+ runner = self.MockTestRunner()
+ broker = message_broker.MultiThreadedBroker(port, options)
+ worker = message_broker._WorkerState('worker-0')
+ worker.thread = child_thread
+ broker._test_runner = runner
+ broker._workers['worker-0'] = worker
+
+ stopping_queue.put('Timeout')
+ broker.run_message_loop()
+ child_thread._timeout_queue.put('done')
child_thread.join(timeout=1.0)
self.assertFalse(astream.empty())