Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make test more reliable
  • Loading branch information
pablogsal committed Dec 1, 2025
commit 6e88425ddd82ffb0c10f82e2191107747063496a
12 changes: 8 additions & 4 deletions Lib/test/test_external_inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2469,16 +2469,20 @@ def recv_msg():

def get_thread_frames(target_funcs):
"""Get frames for thread matching target functions."""
for _ in range(3):
try:
retries = 0
for _ in busy_retry(SHORT_TIMEOUT):
if retries >= 5:
break
retries += 1
# On Windows, ReadProcessMemory can fail with OSError
# (WinError 299) when frame pointers are in flux
with contextlib.suppress(RuntimeError, OSError):
traces = unwinder.get_stack_trace()
for interp in traces:
for thread in interp.threads:
funcs = [f.funcname for f in thread.frame_info]
if any(f in funcs for f in target_funcs):
return funcs
except RuntimeError:
pass
return None

# Track results for each sync point
Expand Down