]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-117658: Fix check_dump_traceback_threads in free-threaded build (#117659)
authorSam Gross <colesbury@gmail.com>
Tue, 9 Apr 2024 15:50:49 +0000 (11:50 -0400)
committerGitHub <noreply@github.com>
Tue, 9 Apr 2024 15:50:49 +0000 (11:50 -0400)
With the GIL disabled, the waiting thread may still be in the
`self.running.set() ` call when faulthandler dumps tracebacks.

Lib/test/test_faulthandler.py

index 200f34d18ca60a603e2749e30e1d8bda8e801092..61ec8fe3151af11fd8db084791c40acf8467500e 100644 (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