Cache execnet gateway rinfo during WorkerController setup
Cache execnet gateway info during WorkerController setup for backward
compatibility, in order to avoid a later main_thread_only deadlock
error triggered when pytest-cov calls rinfo after the main thread is
already busy. See pytest-dev/execnet#274 for corresponding test case.
Fixes: 20e3ac774e ("Use execnet main_thread_only execmodel (#1027)")
This commit is contained in:
@@ -312,6 +312,11 @@ class WorkerController:
|
||||
|
||||
def setup(self) -> None:
|
||||
self.log("setting up worker session")
|
||||
# Cache rinfo for backward compatibility, since pytest-cov
|
||||
# accesses rinfo while the main thread is busy executing our
|
||||
# remote_exec call, which triggers a deadlock error for the
|
||||
# main_thread_only execmodel if the rinfo has not been cached.
|
||||
self.gateway._rinfo()
|
||||
spec = self.gateway.spec
|
||||
args = [str(x) for x in self.config.invocation_params.args or ()]
|
||||
option_dict = {}
|
||||
|
||||
Reference in New Issue
Block a user