🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@sanchit122006
Copy link

@sanchit122006 sanchit122006 commented Dec 19, 2025

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

@timhoffm
Copy link
Member

timhoffm commented Dec 19, 2025

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:

  • in [Bug]: Random timeout failures in CI #30851 (comment) you talked about creationflags=subprocess.CREATE_NO_WINDOW. There's nothing of that to see in here.
  • You are just increasing timeout limits. Do you have any indication that this reduces the frequency of occurance? I'd assume that if the process got hung, it'll hang forever since there are no expensive computations involved.
  • the prints don't make sense to me. What do you want to learn from them.

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.

@sanchit122006
Copy link
Author

@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 😅

@sanchit122006
Copy link
Author

@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
Locally on Windows, using Agg and a separate MPLCONFIG seemed to make startup less variable so it is important thing to be noticed , just tell me what do you me to work on single one or combined ?

@tacaswell
Copy link
Member

#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?

@sanchit122006
Copy link
Author

@tacaswell thanks for suggestion i see that mplbackend issue is already discussed
so i ready to focus on working creationflags=subprocess.CREATE_NO_WINDOW only
Happy to follow up with a CI-only change if that’s useful.

@sanchit122006
Copy link
Author

#30886 Hope this works !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Random timeout failures in CI

3 participants