File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
2+ from concurrent .futures import ThreadPoolExecutor
23
34from collections .abc import Sequence
5+ import time
46import enum
57import fnmatch
68import os
@@ -94,7 +96,12 @@ def setup_nodes(
9496 ) -> list [WorkerController ]:
9597 self .config .hook .pytest_xdist_setupnodes (config = self .config , specs = self .specs )
9698 self .trace ("setting up nodes" )
97- return [self .setup_node (spec , putevent ) for spec in self .specs ]
99+ t = time .monotonic ()
100+ with ThreadPoolExecutor (max_workers = len (self .specs )) as executor :
101+ futs = [executor .submit (self .setup_node , spec , putevent ) for spec in self .specs ]
102+ ret = [f .result () for f in futs ]
103+ print ('setup_nodes took %.3f seconds' % (time .monotonic () - t ))
104+ return ret
98105
99106 def setup_node (
100107 self ,
You can’t perform that action at this time.
0 commit comments