Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
sanchit122006 wants to merge3 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromsanchit122006:dev-mat

Conversation

@sanchit122006
Copy link

@sanchit122006sanchit122006 commentedDec 20, 2025
edited
Loading

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:
image
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

@rcomer
Copy link
Member

So what happened when you tested this locally?

@sanchit122006
Copy link
Author

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.

@sanchit122006sanchit122006 marked this pull request as ready for reviewDecember 20, 2025 14:23
@sanchit122006sanchit122006 marked this pull request as draftDecember 20, 2025 14:24
@sanchit122006sanchit122006 marked this pull request as ready for reviewDecember 20, 2025 14:31
@rcomer
Copy link
Member

rcomer commentedDec 20, 2025
edited
Loading

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
Copy link
Author

@rcomer I'm facing repetetive unpredictable server issues while reproducing tests on my windows setup now

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

Reviewers

@timhoffmtimhoffmtimhoffm left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: Random timeout failures in CI

3 participants

@sanchit122006@rcomer@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp