diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-04-01 13:37:12 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-04-01 13:37:12 (GMT) |
commit | 44378d46f61f70c40a2e157bdf94150ef694f102 (patch) | |
tree | 4adc0412793981239a5a894087b5958049af0333 /Lib/test/test_faulthandler.py | |
parent | fcb88c45030c5480ca184a2911bd3f9357b323d5 (diff) | |
download | cpython-44378d46f61f70c40a2e157bdf94150ef694f102.zip cpython-44378d46f61f70c40a2e157bdf94150ef694f102.tar.gz cpython-44378d46f61f70c40a2e157bdf94150ef694f102.tar.bz2 |
Issue #11393: signal of user signal displays tracebacks even if tstate==NULL
* faulthandler_user() displays the tracebacks of all threads even if it is
unable to get the state of the current thread
* test_faulthandler: only release the GIL in test_gil_released() check
* create check_signum() subfunction
Diffstat (limited to 'Lib/test/test_faulthandler.py')
-rw-r--r-- | Lib/test/test_faulthandler.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py index 5be7c32..a919900 100644 --- a/Lib/test/test_faulthandler.py +++ b/Lib/test/test_faulthandler.py @@ -8,6 +8,8 @@ from test import support, script_helper import tempfile import unittest +TIMEOUT = 0.5 + try: from resource import setrlimit, RLIMIT_CORE, error as resource_error except ImportError: @@ -189,7 +191,7 @@ faulthandler._read_null(True) import faulthandler output = open({filename}, 'wb') faulthandler.enable(output) -faulthandler._read_null(True) +faulthandler._read_null() """.strip().format(filename=repr(filename)), 4, '(?:Segmentation fault|Bus error)', @@ -199,7 +201,7 @@ faulthandler._read_null(True) self.check_fatal_error(""" import faulthandler faulthandler.enable(all_threads=True) -faulthandler._read_null(True) +faulthandler._read_null() """.strip(), 3, '(?:Segmentation fault|Bus error)', @@ -376,7 +378,7 @@ def func(repeat, cancel, timeout): # Check that sleep() was not interrupted assert (b - a) >= min_pause, "{{}} < {{}}".format(b - a, min_pause) -timeout = 0.5 +timeout = {timeout} repeat = {repeat} cancel = {cancel} if {has_filename}: @@ -394,6 +396,7 @@ if file is not None: has_filename=bool(filename), repeat=repeat, cancel=cancel, + timeout=TIMEOUT, ) trace, exitcode = self.get_output(code, filename) trace = '\n'.join(trace) |