@@ -99,39 +99,25 @@ def setup_nodes(
9999
100100 self .config .hook .pytest_xdist_setupnodes (config = self .config , specs = self .specs )
101101 self .trace ("setting up nodes" )
102- import threading
103- lock = threading .Lock ()
104102 with ThreadPoolExecutor (max_workers = len (self .specs )) as executor :
105103 futs = [
106- executor .submit (self .setup_node , spec , putevent , idx , lock )
104+ executor .submit (self .setup_node , spec , putevent , idx )
107105 for idx , spec in enumerate (self .specs )
108106 ]
109107 results = [f .result () for f in futs ]
110108 for r in results :
111109 self .config .hook .pytest_xdist_newgateway (gateway = r .gateway )
112110 return results
113- # return [self.setup_node(spec, putevent) for spec in self.specs]
114111
115112 def setup_node (
116113 self ,
117114 spec : execnet .XSpec ,
118115 putevent : Callable [[tuple [str , dict [str , Any ]]], None ],
119116 idx : int | None = None ,
120- lock = None ,
121117 ) -> WorkerController :
122- if lock is None :
123- import threading
124- lock = threading .Lock ()
125118 if getattr (spec , "execmodel" , None ) != "main_thread_only" :
126119 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 )
130120 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 } " )
135121 self .rsync_roots (gw )
136122 node = WorkerController (self , gw , self .config , putevent )
137123 # Keep the node alive.
0 commit comments