@@ -127,27 +127,20 @@ def console_ctrl_handler(type):
127
127
return True
128
128
lit .util .win32api .SetConsoleCtrlHandler (console_ctrl_handler , True )
129
129
130
- try :
131
- async_results = [
132
- pool .apply_async (lit .worker .execute , args = [test ],
133
- callback = lambda r , t = test : self ._process_result (t , r ))
134
- for test in self .tests ]
135
- pool .close ()
136
-
137
- # Wait for all results to come in. The callback that runs in the
138
- # parent process will update the display.
139
- for a in async_results :
140
- timeout = deadline - time .time ()
141
- a .wait (timeout )
142
- if not a .successful ():
143
- # TODO(yln): this also raises on a --max-time time
144
- a .get () # Exceptions raised here come from the worker.
145
- if self .hit_max_failures :
146
- break
147
- except :
148
- # Stop the workers and wait for any straggling results to come in
149
- # if we exited without waiting on every async result.
150
- pool .terminate ()
151
- raise
152
- finally :
153
- pool .join ()
130
+ async_results = [
131
+ pool .apply_async (lit .worker .execute , args = [test ],
132
+ callback = lambda r , t = test : self ._process_result (t , r ))
133
+ for test in self .tests ]
134
+ pool .close ()
135
+
136
+ for ar in async_results :
137
+ timeout = deadline - time .time ()
138
+ try :
139
+ ar .get (timeout )
140
+ except multiprocessing .TimeoutError :
141
+ # TODO(yln): print timeout error
142
+ pool .terminate ()
143
+ break
144
+ if self .hit_max_failures :
145
+ pool .terminate ()
146
+ break
0 commit comments