Feature or enhancement
The test_threads test checks that py-bt reports when a thread is waiting on the GIL. In the free-threaded build, the GIL will typically be disabled. I think we should just skip the test in that case.
|
def test_threads(self): |
|
'Verify that "py-bt" indicates threads that are waiting for the GIL' |
|
cmd = ''' |
|
from threading import Thread |
|
|
|
class TestThread(Thread): |
|
# These threads would run forever, but we'll interrupt things with the |
|
# debugger |
|
def run(self): |
|
i = 0 |
|
while 1: |
|
i += 1 |
|
|
|
t = {} |
|
for i in range(4): |
|
t[i] = TestThread() |
|
t[i].start() |
|
|
|
# Trigger a breakpoint on the main thread |
|
id(42) |
|
|
|
''' |
|
# Verify with "py-bt": |
|
gdb_output = self.get_stack_trace(cmd, |
|
cmds_after_breakpoint=['thread apply all py-bt']) |
|
self.assertIn('Waiting for the GIL', gdb_output) |
|
|
|
# Verify with "py-bt-full": |
|
gdb_output = self.get_stack_trace(cmd, |
|
cmds_after_breakpoint=['thread apply all py-bt-full']) |
|
self.assertIn('Waiting for the GIL', gdb_output) |
Linked PRs
Feature or enhancement
The
test_threadstest checks thatpy-btreports when a thread is waiting on the GIL. In the free-threaded build, the GIL will typically be disabled. I think we should just skip the test in that case.cpython/Lib/test/test_gdb/test_backtrace.py
Lines 53 to 83 in 027fa2e
Linked PRs