From ae2dd89408fe0b0249dd9e91353f75a2360edb97 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Thu, 21 Jul 2016 14:38:14 +0100 Subject: [PATCH] [Test] Fix braindamaged shutdown_process function --- test/functional/lib/rspamd.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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) -- 2.39.5