We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61ee048 commit 323ecfdCopy full SHA for 323ecfd
Lib/test/test_external_inspection.py
@@ -1752,7 +1752,12 @@ def main_work():
1752
unwinder_gil = RemoteUnwinder(
1753
p.pid, only_active_thread=True
1754
)
1755
- gil_traces = _get_stack_trace_with_retry(unwinder_gil)
+ # Use condition to retry until we capture a thread holding the GIL
1756
+ # (sampling may catch moments with no GIL holder on slow CI)
1757
+ gil_traces = _get_stack_trace_with_retry(
1758
+ unwinder_gil,
1759
+ condition=lambda t: sum(len(i.threads) for i in t) >= 1,
1760
+ )
1761
1762
# Count threads
1763
total_threads = sum(
0 commit comments