From 251ccfde0ddecd291a3a0fd25d1988bd3136864c Mon Sep 17 00:00:00 2001 From: nirenjan Date: Fri, 8 Apr 2022 22:59:37 -0700 Subject: [PATCH] Close command socket in test harness before terminating daemon --- daemon/test_daemon_comm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon/test_daemon_comm.py b/daemon/test_daemon_comm.py index 564d880..a922ea6 100755 --- a/daemon/test_daemon_comm.py +++ b/daemon/test_daemon_comm.py @@ -127,6 +127,11 @@ class Test: if self.daemon is None: return + # Close the command socket and wait 2 seconds for the daemon + # to deregister the client + self.cmdsock.close() + time.sleep(2) + # Send a SIGTERM to the daemon os.kill(self.daemon.pid, signal.SIGTERM) try: @@ -136,7 +141,6 @@ class Test: self.daemon.kill() finally: self.daemon = None - self.cmdsock.close() def append(self, testcase): """Add one testcase to the test case list"""