mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
test_eintr: try to debug hang on FreeBSD
This commit is contained in:
parent
e801c36037
commit
177b8eb34f
1 changed files with 8 additions and 0 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue