File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change 21
21
# Display the running tests if nothing happened last N seconds
22
22
PROGRESS_UPDATE = 30.0 # seconds
23
23
24
+ # If interrupted, display the wait process every N seconds
25
+ WAIT_PROGRESS = 2.0 # seconds
26
+
24
27
25
28
def run_test_in_subprocess (testname , ns ):
26
29
"""Run the given test in a subprocess with --slaveargs.
@@ -224,9 +227,18 @@ def get_running(workers):
224
227
if use_timeout :
225
228
faulthandler .cancel_dump_traceback_later ()
226
229
227
- running = [worker .current_test for worker in workers ]
228
- running = list (filter (bool , running ))
229
- if running :
230
- print ("Waiting for %s" % ', ' .join (running ))
231
- for worker in workers :
232
- worker .join ()
230
+ # If tests are interrupted, wait until tests complete
231
+ wait_start = time .monotonic ()
232
+ while True :
233
+ running = [worker .current_test for worker in workers ]
234
+ running = list (filter (bool , running ))
235
+ if not running :
236
+ break
237
+
238
+ dt = time .monotonic () - wait_start
239
+ line = "Waiting for %s (%s tests)" % (', ' .join (running ), len (running ))
240
+ if dt >= WAIT_PROGRESS :
241
+ line = "%s since %.0f sec" % (line , dt )
242
+ print (line )
243
+ for worker in workers :
244
+ worker .join (WAIT_PROGRESS )
You can’t perform that action at this time.
0 commit comments