Skip to content

Commit

Permalink
Cache execnet gateway rinfo during WorkerController setup
Browse files Browse the repository at this point in the history
Cache execnet gateway info during WorkerController setup in
order to avoid a later deadlock error triggered when pytest-cov
calls rinfo after the main thread is already busy.

Fixes: 20e3ac7 ("Use execnet main_thread_only execmodel (#1027)")
  • Loading branch information
zmedico committed Apr 20, 2024
1 parent 699f939 commit 80f9254
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog/1071.bugfix
@@ -0,0 +1 @@
Add workaround for rinfo compatibility issue with the ``execnet`` new ``main_thread_only`` "execmodel" triggered by pytest-cov (`pytest-dev/execnet#274 <https://github.com/pytest-dev/execnet/pull/274>`__ eliminates the need for this workaround).
2 changes: 2 additions & 0 deletions src/xdist/workermanage.py
Expand Up @@ -312,6 +312,8 @@ def shutting_down(self) -> bool:

def setup(self) -> None:
self.log("setting up worker session")
# Remove this after execnet is fixed in pytest-dev/execnet#274.
self.gateway._rinfo()
spec = self.gateway.spec
args = [str(x) for x in self.config.invocation_params.args or ()]
option_dict = {}
Expand Down

0 comments on commit 80f9254

Please sign in to comment.