mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-136186: Fix more flaky tests in test_external_inspection (#143235)
This commit is contained in:
parent
522563549a
commit
836b2810d5
1 changed files with 6 additions and 1 deletions
|
|
@ -1752,7 +1752,12 @@ def main_work():
|
|||
unwinder_gil = RemoteUnwinder(
|
||||
p.pid, only_active_thread=True
|
||||
)
|
||||
gil_traces = _get_stack_trace_with_retry(unwinder_gil)
|
||||
# Use condition to retry until we capture a thread holding the GIL
|
||||
# (sampling may catch moments with no GIL holder on slow CI)
|
||||
gil_traces = _get_stack_trace_with_retry(
|
||||
unwinder_gil,
|
||||
condition=lambda t: sum(len(i.threads) for i in t) >= 1,
|
||||
)
|
||||
|
||||
# Count threads
|
||||
total_threads = sum(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue