BUG: Reduce flaky Windows subprocess test timeouts#30884
BUG: Reduce flaky Windows subprocess test timeouts#30884sanrishi wants to merge 0 commit intomatplotlib:mainfrom
Conversation
|
I'm sorry. Your PRs have to substantially improve both in communication and in the actual code you are submitting. This totally does not make sense:
Please disclose: Have you used AI to generate the code? If so, to which extent? Do you understand what you are doing here? Please make sure to adhere to out GenAI policy. |
|
@timhoffm yes dear if forget to clarify my idea, i think setting up mplbackend or mplconfig and increase timeout both can reduce some startup flakiness and combined work so well, i tell ai to improve my grammar by giving the prompt sorry 😅 |
|
@timhoffm i am working on adding creationflags=subprocess.CREATE_NO_WINDOW yet ensuring that how both concepts works CREATE_NO_WINDOW and mplbackend or mplconfig |
|
#28781 done is all of the subproces tests may also help (drops a sub-process call to git) or maybe set it at the CI env level so all of our tests see it? |
|
@tacaswell thanks for suggestion i see that mplbackend issue is already discussed |
|
#30886 Hope this works ! |
On Windows (Python 3.11–3.13), tests that spawn subprocesses occasionally time out in CI. The failures are inconsistent, affect different tests across runs, and usually indicate that a subprocess stalled during startup rather than that the test logic itself is broken.
What problem does it solve?
It lowers the frequency of spurious CI failures caused by:
backend auto-detection happening inside subprocesses,
contention around the shared font cache on Windows,
slower and less predictable subprocess startup compared to other platforms.
These issues currently cause otherwise valid PRs to fail CI.
Reasoning for this implementation
The change is applied in subprocess_run_helper, which is the common entry point for the affected tests. Inside the subprocess, the backend is set defensively to avoid auto-detection delays, the font cache is isolated to a temporary directory to prevent cross-process interference, and the timeout is relaxed on Windows only. A small amount of stderr logging is added to help diagnose any remaining stalls.
Linux and macOS behavior is unchanged.
Happy to add more details if needed !
PR checklist