-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Closed
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-free-threadingtype-featureA feature request or enhancementA feature request or enhancement
Description
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.
cpython/Lib/test/test_gdb/test_backtrace.py
Lines 53 to 83 in 027fa2e
| 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
Metadata
Metadata
Assignees
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-free-threadingtype-featureA feature request or enhancementA feature request or enhancement