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

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: 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
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..f82be508ba1f4723f14496fbf335733dad1c7a80 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
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.Watchdog(0))
frankf 2013/04/03 20:49:52 Might want test a positive timeout value as well
craigdh 2013/04/03 21:17:47 The other tests call JoinAll with no arguments whi
+ event.set()
+
if __name__ == '__main__':
unittest.main()

Powered by Google App Engine
This is Rietveld 408576698