INTERNALERROR after upgrading from pytest 8.3.5 to 8.4.0 with pytest-xdist using parallel processing
I just tried to upgrade to the latest pytest 8.4.0. This fails with the following error (command: python -m pytest tests --cov=pypdf --cov-append -n auto -vv):
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/opt/hostedtoolcache/Python/3.13.3/x64/lib/python3.13/site-packages/_pytest/main.py", line 285, in wrap_session
INTERNALERROR> config._do_configure()
INTERNALERROR> ~~~~~~~~~~~~~~~~~~~~^^
INTERNALERROR> File "/opt/hostedtoolcache/Python/3.13.3/x64/lib/python3.13/site-packages/_pytest/config/__init__.py", line 1119, in _do_configure
INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/opt/hostedtoolcache/Python/3.13.3/x64/lib/python3.13/site-packages/pluggy/_hooks.py", line 534, in call_historic
INTERNALERROR> res = self._hookexec(self.name, self._hookimpls.copy(), kwargs, False)
INTERNALERROR> File "/opt/hostedtoolcache/Python/3.13.3/x64/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/opt/hostedtoolcache/Python/3.13.3/x64/lib/python3.13/site-packages/pluggy/_callers.py", line 167, in _multicall
INTERNALERROR> raise exception
INTERNALERROR> File "/opt/hostedtoolcache/Python/3.13.3/x64/lib/python3.13/site-packages/pluggy/_callers.py", line 121, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/opt/hostedtoolcache/Python/3.13.3/x64/lib/python3.13/site-packages/pytest_benchmark/plugin.py", line 528, in pytest_configure
INTERNALERROR> bs = config._benchmarksession = BenchmarkSession(config)
INTERNALERROR> ~~~~~~~~~~~~~~~~^^^^^^^^
INTERNALERROR> File "/opt/hostedtoolcache/Python/3.13.3/x64/lib/python3.13/site-packages/pytest_benchmark/session.py", line 67, in __init__
INTERNALERROR> self.logger.warning(
INTERNALERROR> ~~~~~~~~~~~~~~~~~~~^
INTERNALERROR> 'Benchmarks are automatically disabled because xdist plugin is active.'
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> 'Benchmarks cannot be performed reliably in a parallelized environment.',
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> )
INTERNALERROR> ^
INTERNALERROR> File "/opt/hostedtoolcache/Python/3.13.3/x64/lib/python3.13/site-packages/pytest_benchmark/logger.py", line 39, in warning
INTERNALERROR> warner(PytestBenchmarkWarning(text))
INTERNALERROR> ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> pytest_benchmark.logger.PytestBenchmarkWarning: Benchmarks are automatically disabled because xdist plugin is active.Benchmarks cannot be performed reliably in a parallelized environment.
Previously, this would just log, allowing me to keep all plugins active/installed. Now this seems to stop immediately without running anything.
I guess the root cause is https://github.com/pytest-dev/pytest/issues/10404 as the changelog says
[#10404](https://github.com/pytest-dev/pytest/issues/10404): Apply filterwarnings from config/cli as soon as possible, and revert them as late as possible so that warnings as errors are collected throughout the pytest run and before the unraisable and threadexcept hooks are removed.
I suspect you have filterwarnings = error in your pytest config.
Right
I suspect you have
filterwarnings = errorin your pytest config.
This is indeed correct.
Disabling the plugin with -p no:benchmark resolves this as well (as expected).
I am leaving this up to you whether this is considered a regression which is worth to consider and at least document somewhere or whether this is the intended behavior.