##// END OF EJS Templates
allow iptest to be interrupted...
MinRK -
Show More
@@ -396,6 +396,8 b' class IPTester(object):'
396 """Run the stored commands"""
396 """Run the stored commands"""
397 try:
397 try:
398 retcode = self._run_cmd()
398 retcode = self._run_cmd()
399 except KeyboardInterrupt:
400 return -signal.SIGINT
399 except:
401 except:
400 import traceback
402 import traceback
401 traceback.print_exc()
403 traceback.print_exc()
@@ -412,17 +414,22 b' class IPTester(object):'
412 continue # process is already dead
414 continue # process is already dead
413
415
414 try:
416 try:
415 print('Cleaning stale PID: %d' % subp.pid)
417 print('Cleaning up stale PID: %d' % subp.pid)
416 subp.kill()
418 subp.kill()
417 except: # (OSError, WindowsError) ?
419 except: # (OSError, WindowsError) ?
418 # This is just a best effort, if we fail or the process was
420 # This is just a best effort, if we fail or the process was
419 # really gone, ignore it.
421 # really gone, ignore it.
420 pass
422 pass
423 else:
424 for i in range(10):
425 if subp.poll() is None:
426 time.sleep(0.1)
427 else:
428 break
421
429
422 if subp.poll() is None:
430 if subp.poll() is None:
423 # The process did not die...
431 # The process did not die...
424 print('... failed. Manual cleanup may be required.'
432 print('... failed. Manual cleanup may be required.')
425 % subp.pid)
426
433
427 def make_runners(inc_slow=False):
434 def make_runners(inc_slow=False):
428 """Define the top-level packages that need to be tested.
435 """Define the top-level packages that need to be tested.
@@ -533,6 +540,9 b' def run_iptestall(inc_slow=False):'
533 res = runner.run()
540 res = runner.run()
534 if res:
541 if res:
535 failed.append( (name, runner) )
542 failed.append( (name, runner) )
543 if res == -signal.SIGINT:
544 print("Interrupted")
545 break
536 finally:
546 finally:
537 os.chdir(curdir)
547 os.chdir(curdir)
538 t_end = time.time()
548 t_end = time.time()
General Comments 0
You need to be logged in to leave comments. Login now