mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
faulthandler: dump_tracebacks_later() displays also the timeout
This commit is contained in:
parent
941893291a
commit
c790a5346d
2 changed files with 52 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
|||
from contextlib import contextmanager
|
||||
import datetime
|
||||
import faulthandler
|
||||
import re
|
||||
import signal
|
||||
|
@ -360,6 +361,7 @@ Current thread XXX:
|
|||
|
||||
Raise an error if the output doesn't match the expect format.
|
||||
"""
|
||||
timeout_str = str(datetime.timedelta(seconds=TIMEOUT))
|
||||
code = """
|
||||
import faulthandler
|
||||
import time
|
||||
|
@ -399,7 +401,7 @@ if file is not None:
|
|||
count = loops
|
||||
if repeat:
|
||||
count *= 2
|
||||
header = 'Thread 0x[0-9a-f]+:\n'
|
||||
header = r'Timeout \(%s\)!\nThread 0x[0-9a-f]+:\n' % timeout_str
|
||||
regex = expected_traceback(9, 20, header, count=count)
|
||||
self.assertRegex(trace, regex)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue