From: Andrew Lewis Date: Thu, 21 Jul 2016 13:38:14 +0000 (+0100) Subject: [Test] Fix braindamaged shutdown_process function X-Git-Tag: 1.3.0~26^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F737%2Fhead;p=rspamd.git [Test] Fix braindamaged shutdown_process function --- diff --git a/test/functional/lib/rspamd.py b/test/functional/lib/rspamd.py index 6d03c4d5f..56356e599 100644 --- a/test/functional/lib/rspamd.py +++ b/test/functional/lib/rspamd.py @@ -73,16 +73,11 @@ def shutdown_process(pid): pid = int(pid) process_should_exist(pid) i = 0 - while i < 5: + while i < 100: try: os.kill(pid, signal.SIGTERM) - time.sleep(0.1) - except: + except OSError as e: + assert e.errno == 3 break - if i >= 5: - while True: - try: - os.kill(pid, signal.SIGTERM) - time.sleep(0.1) - except: - break + i += 1 + time.sleep(0.1)