Issue #25277: Set a timeout of 10 minutes in test_eintr using faulthandler to
try to debug a hang on the FreeBSD 9 buildbot. Run also eintr_tester.py with python "-u" command line option to try to get the full output on hang/crash.
This commit is contained in:
parent
2c6ea295ba
commit
98f223dfa0
@ -9,6 +9,7 @@ sub-second periodicity (contrarily to signal()).
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
|
import faulthandler
|
||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
import select
|
import select
|
||||||
@ -50,6 +51,9 @@ class EINTRBaseTest(unittest.TestCase):
|
|||||||
signal.setitimer(signal.ITIMER_REAL, cls.signal_delay,
|
signal.setitimer(signal.ITIMER_REAL, cls.signal_delay,
|
||||||
cls.signal_period)
|
cls.signal_period)
|
||||||
|
|
||||||
|
# Issue #25277: Use faulthandler to try to debug a hang on FreeBSD
|
||||||
|
faulthandler.dump_traceback_later(10 * 60, exit=True)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def stop_alarm(cls):
|
def stop_alarm(cls):
|
||||||
signal.setitimer(signal.ITIMER_REAL, 0, 0)
|
signal.setitimer(signal.ITIMER_REAL, 0, 0)
|
||||||
@ -58,6 +62,7 @@ class EINTRBaseTest(unittest.TestCase):
|
|||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
cls.stop_alarm()
|
cls.stop_alarm()
|
||||||
signal.signal(signal.SIGALRM, cls.orig_handler)
|
signal.signal(signal.SIGALRM, cls.orig_handler)
|
||||||
|
faulthandler.cancel_dump_traceback_later()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _sleep(cls):
|
def _sleep(cls):
|
||||||
|
@ -16,7 +16,8 @@ class EINTRTests(unittest.TestCase):
|
|||||||
# Run the tester in a sub-process, to make sure there is only one
|
# Run the tester in a sub-process, to make sure there is only one
|
||||||
# thread (for reliable signal delivery).
|
# thread (for reliable signal delivery).
|
||||||
tester = support.findfile("eintr_tester.py", subdir="eintrdata")
|
tester = support.findfile("eintr_tester.py", subdir="eintrdata")
|
||||||
script_helper.assert_python_ok(tester)
|
# use -u to try to get the full output if the test hangs or crash
|
||||||
|
script_helper.assert_python_ok("-u", tester)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user