-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[self-tests] test time degradation #13482
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
type: regression
indicates a problem that was introduced in a release which was working previously
type: selftests
a problem in the tests of pytest
Comments
Bisected to 4b32e7c Enhancements to unraisable plugin (#12958). The major chunk of the extra time is cc @graingert |
@graingert any chance you can take a look at this? The CI times are really high, with some jobs taking 30+ minutes... |
nicoddemus
added a commit
to nicoddemus/pytest
that referenced
this issue
Jun 14, 2025
Because `pytester.runpytest()` executes the full session cycle (including `pytest_unconfigure`), it was calling `gc.collect()` in a loop multiple times—even for small, fast tests. This significantly increased the total test suite runtime. To optimize performance, pytester now patches `GC_COLLECT_ITERATIONS` to skip `gc.collect()` entirely, matching the behavior before pytest-dev#12958. Locally the test suite runtime improved dramatically, dropping from 425s to 160s. Fixes pytest-dev#13482.
Proposed a solution in #13513. |
nicoddemus
added a commit
to nicoddemus/pytest
that referenced
this issue
Jun 14, 2025
Because `pytester.runpytest()` executes the full session cycle (including `pytest_unconfigure`), it was calling `gc.collect()` in a loop multiple times—even for small, fast tests. This significantly increased the total test suite runtime. To optimize performance, pytester now patches `GC_COLLECT_ITERATIONS` to skip `gc.collect()` entirely, matching the behavior before pytest-dev#12958. Locally the test suite runtime improved dramatically, dropping from 425s to 160s. Fixes pytest-dev#13482.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
type: regression
indicates a problem that was introduced in a release which was working previously
type: selftests
a problem in the tests of pytest
With
Pytest 8.4.0
its tests suite takes significantly more time (compared toPytest 8.3.5
).pytest's GHA:
8.3.x https://github.com/pytest-dev/pytest/actions/runs/15395204364/job/43314570031
8.4.x https://github.com/pytest-dev/pytest/actions/runs/15400542935/job/43331856904
I can see this locally too.
The text was updated successfully, but these errors were encountered: