Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
BUG: Fix Windows subprocess timeouts with CREATE_NO_WINDOW flag#30886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
rcomer commentedDec 20, 2025
So what happened when you tested this locally? |
Uh oh!
There was an error while loading.Please reload this page.
sanchit122006 commentedDec 20, 2025
I'm leaning on the CI since I don't have a local Windows setup. This fix uses the standard CREATE_NO_WINDOW flag to skip the console overhead (usually 1–3s) that Windows defaults to. It’s a common pattern in other testing tools, but the Azure builds will give us the final word across 3.11 through 3.13. |
rcomer commentedDec 20, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I’m confused. At#30851 (comment) you said you had reproduced the problem in your Windows setup and at#30851 (comment) you said you would test a change locally in your Windows setup. |
sanchit122006 commentedDec 20, 2025
@rcomer I'm facing repetetive unpredictable server issues while reproducing tests on my windows setup now |
Uh oh!
There was an error while loading.Please reload this page.
Fix Windows subprocess timeouts with CREATE_NO_WINDOW flag
The Problem
Windows CI tests have been timing out consistently. Tests like test_lazy_auto_backend_selection, test_interactive_backend, test_fontcache_thread_safe, and many others fail at the 20-second timeout mark. This happens across Python 3.11, 3.12, and 3.13 on Windows.
The common pattern: all these tests spawn subprocesses.
Why It Happens
On Windows, when you create a subprocess, the OS tries to create a console window for it by default. Even though we're running headless tests in CI, Windows still goes through this window creation process. This adds 1-3 seconds of overhead to each subprocess call.
When you have multiple tests spawning subprocesses, these delays add up quickly and push tests over the 20-second timeout limit.
The Fix
Python provides a flag specifically for this: subprocess.CREATE_NO_WINDOW. It tells Windows "don't bother creating a console window for this process."

I added this flag to our subprocess_run_for_testing() helper function, so it automatically applies to all tests that use it:
This way:
It only applies on Windows (no impact on Linux/macOS)
All subprocess-based tests benefit automatically
No changes needed in individual test files
Helps both CI and local Windows development
References
Python docs:subprocess.CREATE_NO_WINDOW
PR checklist