[autest] thread_config: add startup polling and skip test on non-Linux#12940
[autest] thread_config: add startup polling and skip test on non-Linux#12940bryancall merged 2 commits intoapache:masterfrom
Conversation
check_threads.py now uses a short bounded poll/retry window so thread-count validation doesn’t fail on startup races; the test is also skipped on macOS because per-thread introspection used by this check is not reliably available there.
There was a problem hiding this comment.
Pull request overview
This PR updates the thread_config gold test to be more reliable during ATS startup by adding a bounded poll/retry window for thread-count validation, and it restricts the test to platforms where per-thread introspection is supported.
Changes:
- Add a bounded poll/retry loop in
check_threads.pyto avoid thread-count validation failing due to startup races. - Skip the
thread_configgold test on non-Linux platforms viaSkipUnless(IsPlatform("linux")).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/gold_tests/thread_config/thread_config.test.py | Skips the thread configuration test unless running on Linux. |
| tests/gold_tests/thread_config/check_threads.py | Adds retry-based thread counting and expands ATS process matching logic for more robust detection. |
bryancall
left a comment
There was a problem hiding this comment.
Co-pilot made some recommendations. I think the main one is the exit code. Besides that, looks good.
bryancall
left a comment
There was a problem hiding this comment.
The retry logic looks good overall, but there's an exit code ambiguity that should be fixed:
_count_threads_once() returns code 1 when p.threads() fails ("Could not inspect ATS process threads"), but count_threads() treats code 1 as a retryable "process not found yet" condition in retry_codes = {1, 4, 6, 9, 11}. This means a real permission/psutil error gets silently retried for the full 10s window instead of failing immediately.
Please use a distinct exit code (e.g. 12) for the p.threads() failure case so it's not masked by the retry loop.
I've added a distinct exit code 12 for the condition when psutil gets an access denied, so the test fails immediately. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
You can also share your feedback on Copilot code review. Take the survey.
|
Cherry-picked to 10.2.x |
#12940) * thread_config: add startup polling for thread checks and skip on non-Linux check_threads.py now uses a short bounded poll/retry window so thread-count validation does not fail on startup races; the test is also skipped on non-Linux platforms because per-thread introspection used by this check is not reliably available there. * thread_config: stop retrying when Process.threads() access is denied (cherry picked from commit 6dfaadd)
check_threads.py now uses a short bounded poll/retry window so thread-count validation doesn’t fail on startup races.
The test is also skipped on non-Linux because per-thread introspection used by this check is not available there.