@@ -99,39 +99,25 @@ def setup_nodes(
99
99
100
100
self .config .hook .pytest_xdist_setupnodes (config = self .config , specs = self .specs )
101
101
self .trace ("setting up nodes" )
102
- import threading
103
- lock = threading .Lock ()
104
102
with ThreadPoolExecutor (max_workers = len (self .specs )) as executor :
105
103
futs = [
106
- executor .submit (self .setup_node , spec , putevent , idx , lock )
104
+ executor .submit (self .setup_node , spec , putevent , idx )
107
105
for idx , spec in enumerate (self .specs )
108
106
]
109
107
results = [f .result () for f in futs ]
110
108
for r in results :
111
109
self .config .hook .pytest_xdist_newgateway (gateway = r .gateway )
112
110
return results
113
- # return [self.setup_node(spec, putevent) for spec in self.specs]
114
111
115
112
def setup_node (
116
113
self ,
117
114
spec : execnet .XSpec ,
118
115
putevent : Callable [[tuple [str , dict [str , Any ]]], None ],
119
116
idx : int | None = None ,
120
- lock = None ,
121
117
) -> WorkerController :
122
- if lock is None :
123
- import threading
124
- lock = threading .Lock ()
125
118
if getattr (spec , "execmodel" , None ) != "main_thread_only" :
126
119
spec = execnet .XSpec (f"execmodel=main_thread_only//{ spec } " )
127
- # if idx is not None:
128
- # spec = execnet.XSpec(f"{spec}//id=gw{idx}")
129
- print ('theoretical gateway id' , idx , spec .id )
130
120
gw = self .group .makegateway (spec )
131
- # with lock:
132
- # print('calling pytest_xdist_newgateway with gateway id', gw.id)
133
- # self.config.hook.pytest_xdist_newgateway(gateway=gw)
134
- print (f"setup_node: { gw } { spec } " )
135
121
self .rsync_roots (gw )
136
122
node = WorkerController (self , gw , self .config , putevent )
137
123
# Keep the node alive.
0 commit comments