summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-03-31 09:34:08 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-03-31 09:34:08 (GMT)
commitf0480750796df39b6c356fbfe1cdcb395725654c (patch)
treec084fe744e891d53ee9a995cbd65d5d4f9a07a93 /Lib
parent702624ecf7fa0b7247b2bd07962db30d3e53885d (diff)
downloadcpython-f0480750796df39b6c356fbfe1cdcb395725654c.zip
cpython-f0480750796df39b6c356fbfe1cdcb395725654c.tar.gz
cpython-f0480750796df39b6c356fbfe1cdcb395725654c.tar.bz2
Issue #11393: limit stack overflow test to 100 MB
Stop if the stack overflow doesn't occur after allocating 100 MB on the stack.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_faulthandler.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py
index 4cf98b0..3c8c8eb 100644
--- a/Lib/test/test_faulthandler.py
+++ b/Lib/test/test_faulthandler.py
@@ -69,7 +69,7 @@ class FaultHandlerTests(unittest.TestCase):
return output.splitlines()
def check_fatal_error(self, code, line_number, name_regex,
- filename=None, all_threads=False):
+ filename=None, all_threads=False, other_regex=None):
"""
Check that the fault handler for fatal errors is enabled and check the
traceback from the child process output.
@@ -90,6 +90,8 @@ class FaultHandlerTests(unittest.TestCase):
lineno=line_number,
name=name_regex,
header=re.escape(header))
+ if other_regex:
+ regex += '|' + other_regex
output = self.get_output(code, False, filename)
output = '\n'.join(output)
self.assertRegex(output, regex)
@@ -153,7 +155,6 @@ faulthandler._fatal_error(b'xyz')
2,
'xyz')
- @unittest.skipIf(True, 'test disabled, see #11393')
@unittest.skipIf(not hasattr(faulthandler, '_stack_overflow'),
'need faulthandler._stack_overflow()')
def test_stack_overflow(self):
@@ -163,7 +164,8 @@ faulthandler.enable()
faulthandler._stack_overflow()
""".strip(),
3,
- '(?:Segmentation fault|Bus error)')
+ '(?:Segmentation fault|Bus error)',
+ other_regex='unable to raise a stack overflow')
def test_gil_released(self):
self.check_fatal_error("""