@@ -19,11 +19,6 @@ class Run(object):
19
19
def __init__ (self , lit_config , tests ):
20
20
self .lit_config = lit_config
21
21
self .tests = tests
22
- # Set up semaphores to limit parallelism of certain classes of tests.
23
- self .parallelism_semaphores = {
24
- k : NopSemaphore () if v is None else
25
- multiprocessing .BoundedSemaphore (v )
26
- for k , v in lit_config .parallelism_groups .items ()}
27
22
28
23
def execute_tests (self , progress_callback , workers , max_time ):
29
24
"""
@@ -76,14 +71,18 @@ def _execute_in_parallel(self, workers, max_time):
76
71
if max_time :
77
72
deadline = time .time () + max_time
78
73
74
+ semaphores = {
75
+ k : NopSemaphore () if v is None else
76
+ multiprocessing .BoundedSemaphore (v ) for k , v in
77
+ self .lit_config .parallelism_groups .items ()}
78
+
79
79
# Start a process pool. Copy over the data shared between all test runs.
80
80
# FIXME: Find a way to capture the worker process stderr. If the user
81
81
# interrupts the workers before we make it into our task callback, they
82
82
# will each raise a KeyboardInterrupt exception and print to stderr at
83
83
# the same time.
84
84
pool = multiprocessing .Pool (workers , lit .worker .initializer ,
85
- (self .lit_config ,
86
- self .parallelism_semaphores ))
85
+ (self .lit_config , semaphores ))
87
86
88
87
# Install a console-control signal handler on Windows.
89
88
if lit .util .win32api is not None :
0 commit comments