fix again

This commit is contained in:
Shane Smiskol
2025-07-25 19:36:55 -07:00
parent 68bf76dce4
commit f8ea4a23b7

View File

@@ -97,19 +97,20 @@ class NodeManager:
self.trace("setting up nodes")
with ThreadPoolExecutor(max_workers=len(self.specs)) as executor:
futs = [
executor.submit(self.setup_node, idx, spec, putevent)
executor.submit(self.setup_node, spec, putevent, idx)
for idx, spec in enumerate(self.specs)
]
return [f.result() for f in futs]
def setup_node(
self,
idx: int,
spec: execnet.XSpec,
putevent: Callable[[tuple[str, dict[str, Any]]], None],
idx: int = None,
) -> WorkerController:
if getattr(spec, "execmodel", None) != "main_thread_only":
spec = execnet.XSpec(f"execmodel=main_thread_only//{spec}")
if idx is not None:
spec = execnet.XSpec(f"{spec}//id=gw{idx}")
gw = self.group.makegateway(spec)
self.config.hook.pytest_xdist_newgateway(gateway=gw)