gh-117658: Fix check_dump_traceback_threads in free-threaded build (#117659)

With the GIL disabled, the waiting thread may still be in the
`self.running.set() ` call when faulthandler dumps tracebacks.
This commit is contained in:
Sam Gross 2024-04-09 11:50:49 -04:00 committed by GitHub
parent fa58e75a86
commit 6edde8a91c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -575,10 +575,12 @@ class FaultHandlerTests(unittest.TestCase):
lineno = 8
else:
lineno = 10
# When the traceback is dumped, the waiter thread may be in the
# `self.running.set()` call or in `self.stop.wait()`.
regex = r"""
^Thread 0x[0-9a-f]+ \(most recent call first\):
(?: File ".*threading.py", line [0-9]+ in [_a-z]+
){{1,3}} File "<string>", line 23 in run
){{1,3}} File "<string>", line (?:22|23) in run
File ".*threading.py", line [0-9]+ in _bootstrap_inner
File ".*threading.py", line [0-9]+ in _bootstrap