Skip to content

TST: always force the SETUPTOOLS_SCM version in test subprocesses - #30947

Merged
timhoffm merged 2 commits into
matplotlib:mainfrom
tacaswell:tst/set_version
Jan 12, 2026
Merged

timhoffm merged 2 commits into
matplotlib:mainfrom
tacaswell:tst/set_version

Conversation

@tacaswell

Copy link
Copy Markdown
Member

This will reduce the number of (sub)subprocess calls we make by at least one per subprocess test. This may help reduce resource contention on CI that causes flaky tests.

PR summary

We have a number of tests that fail intermittently on windows and macOS. One theory is that we are exhausting something about the number of processes on these systems that is either freezing (or at least delaying longer than we wait) the tests run in subprocesses. Our versioning scheme will ask git for the current version (tag + distance + current SHA) so in ever subprocess we are making further subprocess calls to git. By passing the version down via ENV like this we will reduce the number of subprocess calls and hopefully reduce the pressure that is causing the failures.

This will reduce the number of (sub)subprocess calls we make by at least one per
subprocess test.  This may help reduce resource contention on CI that causes
flaky tests.
@tacaswell tacaswell added this to the v3.11.0 milestone Jan 9, 2026
Comment thread lib/matplotlib/testing/__init__.py Resolved
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
@tacaswell

Copy link
Copy Markdown
Member Author

Sorry, I copied this from where we set it in the pickle test and failed to completely copy-edit it.

@QuLogic

QuLogic commented Jan 12, 2026

Copy link
Copy Markdown
Member

It seems reasonable, but also we're still getting timeouts?

@timhoffm

Copy link
Copy Markdown
Member

It may well be that we have different kind of timeouts. There are the windows ones which can happen across many different tests using subprocesses. And there is macos, which seems to only timeout for test_webagg. Anyway, it's reasonable to force SETUPTOOLS_SCM.

@timhoffm
timhoffm merged commit 64cda24 into matplotlib:main Jan 12, 2026
38 of 40 checks passed
@tacaswell
tacaswell deleted the tst/set_version branch January 12, 2026 15:49
@timhoffm

timhoffm commented Feb 2, 2026

Copy link
Copy Markdown
Member

We specifically still also have the windows timeouts (e.g. https://dev.azure.com/matplotlib/matplotlib/_build/results?buildId=46877&view=logs&j=f92c32cd-721a-536e-3a87-a0c010db3f7f&t=d4eecd58-7131-52e4-f793-e9e3ca32dedb), but they are much rarer since this PR was merged. So it's good to have this PR in to reduce the number of subprocesses, but it doesn't solve the root cause.

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.

3 participants