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

Unified Diff: build/android/pylib/utils/reraiser_thread_unittest.py

Issue 13590002: [Android] Print the stack of deadlocked threads when sharding. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: additional '*' * 80 to make frankf happy Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/utils/reraiser_thread.py ('k') | build/android/pylib/utils/watchdog_timer.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/utils/reraiser_thread_unittest.py
diff --git a/build/android/pylib/utils/reraiser_thread_unittest.py b/build/android/pylib/utils/reraiser_thread_unittest.py
index 9228829fa23e25c98cb683d635d37ac36a547473..916d47efbc21897ce86e97db8daf9874d67f632e 100644
--- a/build/android/pylib/utils/reraiser_thread_unittest.py
+++ b/build/android/pylib/utils/reraiser_thread_unittest.py
@@ -4,9 +4,11 @@
"""Unittests for reraiser_thread.py."""
+import threading
import unittest
import reraiser_thread
+import watchdog_timer
class TestException(Exception):
@@ -75,6 +77,20 @@ class TestReraiserThreadGroup(unittest.TestCase):
with self.assertRaises(TestException):
group.JoinAll()
+ def testJoinTimeout(self):
+ def f():
+ pass
+ event = threading.Event()
+ def g():
+ event.wait()
+ group = reraiser_thread.ReraiserThreadGroup(
+ [reraiser_thread.ReraiserThread(g),
+ reraiser_thread.ReraiserThread(f)])
+ group.StartAll()
+ with self.assertRaises(reraiser_thread.TimeoutError):
+ group.JoinAll(watchdog_timer.WatchdogTimer(0.01))
+ event.set()
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « build/android/pylib/utils/reraiser_thread.py ('k') | build/android/pylib/utils/watchdog_timer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698