Skip to content

Commit b397288

Browse files
authored
Merge pull request #1072 from zmedico/gateway-cache-rinfo
Cache execnet gateway rinfo during WorkerController setup
2 parents c93a106 + 12b3cce commit b397288

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Diff for: changelog/1071.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add backward compatibility for deadlock issue with the ``execnet`` new ``main_thread_only`` "execmodel" triggered when pytest-cov accesses rinfo.

Diff for: src/xdist/workermanage.py

+5
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ def shutting_down(self) -> bool:
312312

313313
def setup(self) -> None:
314314
self.log("setting up worker session")
315+
# Cache rinfo for backward compatibility, since pytest-cov
316+
# accesses rinfo while the main thread is busy executing our
317+
# remote_exec call, which triggers a deadlock error for the
318+
# main_thread_only execmodel if the rinfo has not been cached.
319+
self.gateway._rinfo()
315320
spec = self.gateway.spec
316321
args = [str(x) for x in self.config.invocation_params.args or ()]
317322
option_dict = {}

0 commit comments

Comments
 (0)