Skip to content

Conversation

@pablogsal
Copy link
Member

@pablogsal pablogsal commented Dec 23, 2025

Several tests calling unwinder.get_stack_trace() were flaky because they
used retry loops without exception handling. Transient failures like
"Failed to parse initial frame in chain" that occur when sampling at an
inopportune moment would immediately fail the test instead of being
retried.

The fix adds a _get_stack_trace_with_retry helper function and updates
seven locations to use busy_retry with contextlib.suppress for OSError
and RuntimeError, matching the existing pattern in
_get_frames_with_retry. This allows transient failures to be silently
retried while still timing out if the expected condition is never met.

@bedevere-app bedevere-app bot added tests Tests in the Lib/test dir awaiting core review labels Dec 23, 2025
@pablogsal pablogsal changed the title Fix flaky tests in test_external_inspection gh-136186: Fix flaky tests in test_external_inspection Dec 23, 2025
Several tests calling unwinder.get_stack_trace() were flaky because they
used retry loops without exception handling. Transient failures like
"Failed to parse initial frame in chain" that occur when sampling at an
inopportune moment would immediately fail the test instead of being
retried.

The fix adds a _get_stack_trace_with_retry helper function and updates
seven locations to use busy_retry with contextlib.suppress for OSError
and RuntimeError, matching the existing pattern in
_get_frames_with_retry. This allows transient failures to be silently
retried while still timing out if the expected condition is never met.
@pablogsal pablogsal added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 23, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @pablogsal for commit 9309fbc 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F143110%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 23, 2025
@pablogsal pablogsal added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 23, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @pablogsal for commit 0d68f47 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F143110%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 23, 2025
@pablogsal pablogsal added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 23, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @pablogsal for commit 48cba1f 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F143110%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 23, 2025
@pablogsal
Copy link
Member Author

All buildbots are ok with this commit so I think this will take care of the flakyness

@pablogsal pablogsal merged commit 9af7a20 into python:main Dec 24, 2025
112 of 115 checks passed
@pablogsal pablogsal deleted the gh-136186 branch December 24, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants