Skip to content
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

pytest_handlecrashitem faults with NotImplementedError when using the loadgroup test distribution algorithm #247

Open
hb2638 opened this issue Dec 14, 2023 · 1 comment
Labels
bug help wanted a pull request to fix this issue is welcome

Comments

@hb2638
Copy link

hb2638 commented Dec 14, 2023

I'm using xdist with the --dist loadgroup command line option and the reruns are not working for crashed nodes because xdist's LoadScopeScheduling.mark_test_pending for throws a NotImplementedError error @ https://github.com/pytest-dev/pytest-xdist/blob/master/src/xdist/scheduler/loadscope.py#L244

[gw2] node down: Not properly terminated
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/_pytest/main.py", line 271, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/_pytest/main.py", line 325, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in call
INTERNALERROR> return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/pluggy/_callers.py", line 152, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/pluggy/_result.py", line 114, in get_result
INTERNALERROR> raise exc.with_traceback(exc.traceback)
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/pluggy/_callers.py", line 77, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/xdist/dsession.py", line 123, in pytest_runtestloop
INTERNALERROR> self.loop_once()
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/xdist/dsession.py", line 148, in loop_once
INTERNALERROR> call(**kwargs)
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/xdist/dsession.py", line 217, in worker_errordown
INTERNALERROR> self.handle_crashitem(crashitem, node)
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/xdist/dsession.py", line 382, in handle_crashitem
INTERNALERROR> self.config.hook.pytest_handlecrashitem(
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/pluggy/_hooks.py", line 493, in call
INTERNALERROR> return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/pluggy/_manager.py", line 115, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/pluggy/_callers.py", line 113, in _multicall
INTERNALERROR> raise exception.with_traceback(exception.traceback)
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/pluggy/_callers.py", line 77, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/pytest_rerunfailures.py", line 351, in pytest_handlecrashitem
INTERNALERROR> sched.mark_test_pending(crashitem)
INTERNALERROR> File "/usr/local/lib/python3.11/site-packages/xdist/scheduler/loadscope.py", line 245, in mark_test_pending
INTERNALERROR> raise NotImplementedError()
INTERNALERROR> NotImplementedError
= 4 failed, 1155 passed, 286 skipped, 87 warnings, 10 rerun in 4137.10s (1:08:57) =

@icemac icemac added bug help wanted a pull request to fix this issue is welcome labels Dec 15, 2023
@icemac
Copy link
Contributor

icemac commented Dec 15, 2023

Thank you for your PR. I do not know anything about the loadgroup test distribution algorithm.
So a PR is welcome to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted a pull request to fix this issue is welcome
Projects
None yet
Development

No branches or pull requests

2 participants