From 65ef2ca80c89020b80ab7e4a5fac0fa784a9495b Mon Sep 17 00:00:00 2001 From: kostas Date: Tue, 30 Apr 2024 10:51:07 +0300 Subject: [PATCH 1/2] fix: check return code of process after communicate --- tests/dragonfly/instance.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/dragonfly/instance.py b/tests/dragonfly/instance.py index 0631b6c9da8b..ead154ac96b7 100644 --- a/tests/dragonfly/instance.py +++ b/tests/dragonfly/instance.py @@ -170,6 +170,11 @@ def stop(self, kill=False): else: proc.terminate() proc.communicate(timeout=15) + # if the return code is 0 it means normal termination + # if the return code is negative it means termination by signal + # if the return code is positive it means abnormal exit + if proc.returncode > 0: + raise subprocess.TimeoutExpired except subprocess.TimeoutExpired: # We need to send SIGUSR1 to DF such that it prints the stacktrace From d49580ea130129a24f64d32042f010ccb0c8c4f3 Mon Sep 17 00:00:00 2001 From: kostas Date: Tue, 30 Apr 2024 18:52:28 +0300 Subject: [PATCH 2/2] address gh comments --- tests/dragonfly/instance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/dragonfly/instance.py b/tests/dragonfly/instance.py index ead154ac96b7..ac6d8d9af52c 100644 --- a/tests/dragonfly/instance.py +++ b/tests/dragonfly/instance.py @@ -173,8 +173,8 @@ def stop(self, kill=False): # if the return code is 0 it means normal termination # if the return code is negative it means termination by signal # if the return code is positive it means abnormal exit - if proc.returncode > 0: - raise subprocess.TimeoutExpired + if proc.returncode != 0: + raise Exception("Dragfonfly did not terminate gracefully") except subprocess.TimeoutExpired: # We need to send SIGUSR1 to DF such that it prints the stacktrace