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

Release 3.6.0 #1070

Merged
merged 1 commit into from Apr 19, 2024
Merged

Release 3.6.0 #1070

merged 1 commit into from Apr 19, 2024

Conversation

bluetech
Copy link
Member

No description provided.

CHANGELOG.rst Outdated
Comment on lines 7 to 14
- `#1024 <https://github.com/pytest-dev/pytest-xdist/issues/1024>`_: Added proper handling of ``shouldstop`` (such as set by ``--max-fail``) and ``shouldfail`` conditions in workers.
Previously, a worker might have continued executing further tests before the controller could terminate the session.

- `#1028 <https://github.com/pytest-dev/pytest-xdist/issues/1028>`_: Fix compatiblity issue between `looponfail` and editable installs.

- `#620 <https://github.com/pytest-dev/pytest-xdist/issues/620>`_: Use the ``execnet`` new ``main_thread_only`` "execmodel" so that code which expects to only run in the main thread will now work as expected.

- `#937 <https://github.com/pytest-dev/pytest-xdist/issues/937>`_: Fix a bug where plugin would raise an incompatibility error with ``--pdb`` despite using ``-n0``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor adjustments.

Suggested change
- `#1024 <https://github.com/pytest-dev/pytest-xdist/issues/1024>`_: Added proper handling of ``shouldstop`` (such as set by ``--max-fail``) and ``shouldfail`` conditions in workers.
Previously, a worker might have continued executing further tests before the controller could terminate the session.
- `#1028 <https://github.com/pytest-dev/pytest-xdist/issues/1028>`_: Fix compatiblity issue between `looponfail` and editable installs.
- `#620 <https://github.com/pytest-dev/pytest-xdist/issues/620>`_: Use the ``execnet`` new ``main_thread_only`` "execmodel" so that code which expects to only run in the main thread will now work as expected.
- `#937 <https://github.com/pytest-dev/pytest-xdist/issues/937>`_: Fix a bug where plugin would raise an incompatibility error with ``--pdb`` despite using ``-n0``.
- `#1024 <https://github.com/pytest-dev/pytest-xdist/issues/1024>`_: Added proper handling of ``shouldstop`` (such as set by ``--max-fail``) and ``shouldfail`` conditions in workers.
Previously, a worker might have continued executing further tests before the controller could terminate the session.
- `#1028 <https://github.com/pytest-dev/pytest-xdist/issues/1028>`_: Fixed compatiblity issue between `looponfail` and editable installs.
- `#620 <https://github.com/pytest-dev/pytest-xdist/issues/620>`_: Use the new ``main_thread_only`` ``execnet`` "execmodel" so that code which expects to only run in the main thread will now work as expected.
- `#937 <https://github.com/pytest-dev/pytest-xdist/issues/937>`_: Fixed a bug where plugin would raise an incompatibility error with ``--pdb`` despite using ``-n0``.

@bluetech
Copy link
Member Author

Noticed in the deployment review that 1027.improvement.rst was not handled, and also forgot to apply Bruno's suggestion, fixing...

@bluetech bluetech merged commit 699f939 into master Apr 19, 2024
24 checks passed
@bluetech bluetech deleted the release-3.6.0 branch April 19, 2024 19:49
@webknjaz
Copy link
Member

@bluetech @RonnyPfannschmidt this caused a regression, it seems. See how it fails in setuptools' CI: https://github.com/pypa/setuptools/actions/runs/8759251151/job/24041851385?pr=4092#step:9:114. I was constantly pushing new changes to a PR, working on a CI fix for something else, and one minute it was fine but later on it started failing due to unrelated changes. When I checked the logs and verified that it's unpinned, I confirmed that the working CI was using pytest-xdist==3.5.0 (like the last commit on main) while the broken one started using pytest-xdist==3.6.0.

Here's how it explodes:

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/_pytest/main.py", line 273, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>                          ^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/_pytest/main.py", line 327, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
INTERNALERROR>     raise exc.with_traceback(exc.__traceback__)
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
INTERNALERROR>     teardown.throw(outcome._exception)
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/_pytest/logging.py", line 796, in pytest_runtestloop
INTERNALERROR>     return (yield)  # Run all the tests.
INTERNALERROR>             ^^^^^
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/xdist/dsession.py", line 138, in pytest_runtestloop
INTERNALERROR>     self.loop_once()
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/xdist/dsession.py", line 163, in loop_once
INTERNALERROR>     call(**kwargs)
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/xdist/dsession.py", line 201, in worker_workerfinished
INTERNALERROR>     self.config.hook.pytest_testnodedown(node=node, error=None)
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/pytest_cov/plugin.py", line 316, in pytest_testnodedown
INTERNALERROR>     self.cov_controller.testnodedown(node, error)
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/pytest_cov/engine.py", line 342, in testnodedown
INTERNALERROR>     rinfo = node.gateway._rinfo()
INTERNALERROR>             ^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/execnet/gateway.py", line 87, in _rinfo
INTERNALERROR>     self._cache_rinfo = RInfo(ch.receive())
INTERNALERROR>                               ^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/setuptools/setuptools/.tox/py/lib/python3.11/site-packages/execnet/gateway_base.py", line 934, in receive
INTERNALERROR>     raise self._getremoteerror() or EOFError()
INTERNALERROR> execnet.gateway_base.RemoteError: concurrent remote_exec would cause deadlock for main_thread_only execmodel

@bluetech
Copy link
Member Author

@webknjaz I was not involved in this change personally so I can't really comment on it, but given the stacktrace you've given it seems like maybe the comment in pytest-dev/execnet#243 "Testing of main_thread_only with pytest-xdist has shown that this behavior is compatible with the existing pytest-xdist usage because it never calls remote_exec more than once per gateway" is not borne out.

Do you mind opening an issue about this so we can solicit more reports? Worse thing, if this turns out to be a widespread regression and @RonnyPfannschmidt or @zmedico don't have a chance to comment, I can revert the change and do a 3.6.1 release tomorrow.

@webknjaz
Copy link
Member

@bluetech Thanks! I'll open another issue in this repo. Just wanted to post something immediately where most context seems to exist.

In case of more regression reports I suggest marking the version as yanked on PyPI instead of reverting prematurely. It'll let pip avoid this version by default.

@webknjaz
Copy link
Member

xref #1071

zmedico added a commit to zmedico/execnet that referenced this pull request Apr 19, 2024
This should fix a bug triggered by pytest-cov when it tries to
call _rinfo after the gateway is already busy with a remote_exec
call:

pytest-dev/pytest-xdist#1070 (comment)
@webknjaz
Copy link
Member

webknjaz commented Apr 19, 2024

@bluetech since the cause has been identified to be pytest-cov (#620 (comment)) which is used in tandem with pytest-xdist more often than not, I expect that this will indeed affect a lot of projects. So I'd recommend yanking the broken execnet version as soon as you get to PyPI UI and then, unyanking it once pytest-dev/execnet#274 is released.

zmedico added a commit to zmedico/execnet that referenced this pull request Apr 19, 2024
This should fix a bug triggered by pytest-cov when it tries to
call _rinfo after the gateway is already busy with a remote_exec
call:

pytest-dev/pytest-xdist#1070 (comment)
zmedico added a commit to zmedico/execnet that referenced this pull request Apr 19, 2024
Fix a bug triggered by pytest-cov when it tries to call _rinfo
after the gateway is already busy with a remote_exec call:

pytest-dev/pytest-xdist#1070 (comment)
zmedico added a commit to zmedico/execnet that referenced this pull request Apr 21, 2024
Fix a bug triggered by pytest-cov when it tries to call _rinfo
after the gateway is already busy with a remote_exec call:

pytest-dev/pytest-xdist#1070 (comment)
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.

None yet

4 participants