Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-140381: Handle slower machines in test_profiling#140460

Closed
stefanor wants to merge 3 commits intopython:mainfrom
stefanor:slow-profiling
Closed

gh-140381: Handle slower machines in test_profiling#140460
stefanor wants to merge 3 commits intopython:mainfrom
stefanor:slow-profiling

Conversation

@stefanor
Copy link
Copy Markdown
Contributor

@stefanor stefanor commented Oct 22, 2025

While looking at #140028 I found some test failures that are caused by new tests (from #138122) running too slowly.

This adds an arbitrary heuristic to 10x the sampling run time (to the default value of 10 seconds). Doubling the 1-second duration was sufficient for my HP PA tests, but Fedora reported one of the 2-second durations being too slow for a freethreaded build.

@stefanor
Copy link
Copy Markdown
Contributor Author

This adds an arbitrary heuristic to double the sampling run time. We could do 10x instead? And/or move the heuristic into test_support. Thoughts?

After seeing that Fedora hit this one of of the tests that ran with -d 2, I think 10x is the way to go. Implementing.

While looking at python#140028 I found some test failures that are caused by
new tests (from python#138122) running too slowly.

This adds an arbitrary heuristic to 10x the sampling run time (to the
default value of 10 seconds). Doubling the 1-second duration was
sufficient for my HP PA tests, but Fedora reported one of the 2-second
durations being too slow for a freethreaded build.

This heuristic could move into test_support. Thoughts?
Comment thread Lib/test/test_profiling/test_sampling_profiler.py Outdated
@pablogsal
Copy link
Copy Markdown
Member

Thanks for the PR but unfortunately this solution looks flaky. I am not sure it will generalize to all the machines and we cannot just have hardcoded numbers. I think that I would try something like what @zooba proposes in #140381 (comment)

@stefanor
Copy link
Copy Markdown
Contributor Author

Yep, that looks a lot cleaner!

@stefanor stefanor closed this Nov 19, 2025
@stefanor stefanor deleted the slow-profiling branch November 19, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants