summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-09-02 15:19:04 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-09-02 15:19:04 (GMT)
commit177b8eb34fed9a299ad00cea8e8be45fd836ab91 (patch)
tree59a5c4d2a058fe8eafec8da0a19630fdad69d49e
parente801c36037bf3875de0ecbb79c9f9ba8938027da (diff)
downloadcpython-177b8eb34fed9a299ad00cea8e8be45fd836ab91.zip
cpython-177b8eb34fed9a299ad00cea8e8be45fd836ab91.tar.gz
cpython-177b8eb34fed9a299ad00cea8e8be45fd836ab91.tar.bz2
test_eintr: try to debug hang on FreeBSD
-rw-r--r--Lib/test/eintrdata/eintr_tester.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/eintrdata/eintr_tester.py b/Lib/test/eintrdata/eintr_tester.py
index f755880..73711a4 100644
--- a/Lib/test/eintrdata/eintr_tester.py
+++ b/Lib/test/eintrdata/eintr_tester.py
@@ -8,6 +8,7 @@ Signals are generated in-process using setitimer(ITIMER_REAL), which allows
sub-second periodicity (contrarily to signal()).
"""
+import faulthandler
import io
import os
import select
@@ -36,10 +37,17 @@ class EINTRBaseTest(unittest.TestCase):
cls.orig_handler = signal.signal(signal.SIGALRM, lambda *args: None)
signal.setitimer(signal.ITIMER_REAL, cls.signal_delay,
cls.signal_period)
+ if hasattr(faulthandler, 'dump_traceback_later'):
+ # Most tests take less than 30 seconds, so 15 minutes should be
+ # enough. dump_traceback_later() is implemented with a thread, but
+ # pthread_sigmask() is used to mask all signaled on this thread.
+ faulthandler.dump_traceback_later(15 * 60, exit=True)
@classmethod
def stop_alarm(cls):
signal.setitimer(signal.ITIMER_REAL, 0, 0)
+ if hasattr(faulthandler, 'cancel_dump_traceback_later'):
+ faulthandler.cancel_dump_traceback_later()
@classmethod
def tearDownClass(cls):