question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'WorkerController' object has no attribute 'slaveinput'

See original GitHub issue

I recently upgraded from pytest-xdist 1.34.0 to 2.0.0 and found that tests always fail with the new version. I pinned the previous version as a workaround.

I’ve tested on Ubuntu 18.04 and the circle CI docker image for python 3.7.6

If I remove --cov=project_folder (project_folder was redacted), the tests run successfully.

pytest --numprocesses=auto --cov=project_folder test itest

============================= test session starts ==============================
platform linux -- Python 3.7.6, pytest-6.0.1, py-1.9.0, pluggy-0.13.1
rootdir: /root/repo
plugins: xdist-2.0.0, forked-1.3.0, cov-2.10.0
gw0 C / gw1 I / gw2 I / gw3 I / gw4 I / gw5 I / gw6 I / gw7 I / gw8 I / gw9 I / gw10 I / gw11 I / gw12 I / gw13 I / gw14 I / gw15 I / gw16 I / gw17 IINTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/_pytest/main.py", line 238, in wrap_session
INTERNALERROR>     config.hook.pytest_sessionstart(session=session)
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/xdist/dsession.py", line 78, in pytest_sessionstart
INTERNALERROR>     nodes = self.nodemanager.setup_nodes(putevent=self.queue.put)
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/xdist/workermanage.py", line 65, in setup_nodes
INTERNALERROR>     return [self.setup_node(spec, putevent) for spec in self.specs]
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/xdist/workermanage.py", line 65, in <listcomp>
INTERNALERROR>     return [self.setup_node(spec, putevent) for spec in self.specs]
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/xdist/workermanage.py", line 73, in setup_node
INTERNALERROR>     node.setup()
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/xdist/workermanage.py", line 260, in setup
INTERNALERROR>     self.config.hook.pytest_configure_node(node=self)
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/pytest_cov/plugin.py", line 239, in pytest_configure_node
INTERNALERROR>     self.cov_controller.configure_node(node)
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/pytest_cov/engine.py", line 274, in configure_node
INTERNALERROR>     workerinput(node).update({
INTERNALERROR>   File "/root/repo/venv/lib/python3.7/site-packages/pytest_cov/compat.py", line 42, in fn
INTERNALERROR>     return getattr(obj, attr, *args)
INTERNALERROR> AttributeError: 'WorkerController' object has no attribute 'slaveinput'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
graingertcommented, Aug 14, 2020

hello @bruceduhamel this is an issue in pytest-cov, fixed in the unreleased https://github.com/pytest-dev/pytest-cov/pull/412

0reactions
nicoddemuscommented, Aug 14, 2020

A major release should not be made on Friday.

To be fair, we really did our homework in https://github.com/pytest-dev/pytest-xdist/pull/541 by contacting all affected repositories, contributing PRs, etc. And that has been resolved for awhile now.

It would be great if pytest-cov could make a new release to fix this, and avoid further noise by having to yank that version from PyPI.

cc @ionelmc

Nevermind, I see that this is already in the works: https://github.com/pytest-dev/pytest-cov/issues/422, thanks @ionelmc for the quick response here. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

sqlalchemy/devel - Gitter
INTERNALERROR> AttributeError: 'WorkerController' object has no attribute 'slaveinput' ERROR: InvocationError for command ...
Read more >
How to access a shared resource with pytest-xdist?
I think there are a number of ways to address your question. config.option content is shared between master and workers.
Read more >
pytest-reportportal 5.0.5 incompatible with pytest 6.0.1
INTERNALERROR> AttributeError: 'WorkerController' object has no attribute 'slaveinput'. To Reproduce run tests with -n <num of workers more than 1> with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found