Close command socket in test harness before terminating daemon

reverse-scroll
nirenjan 2022-04-08 22:59:37 -07:00
parent 611bc9d965
commit 251ccfde0d
1 changed files with 5 additions and 1 deletions

View File

@ -127,6 +127,11 @@ class Test:
if self.daemon is None: if self.daemon is None:
return 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 # Send a SIGTERM to the daemon
os.kill(self.daemon.pid, signal.SIGTERM) os.kill(self.daemon.pid, signal.SIGTERM)
try: try:
@ -136,7 +141,6 @@ class Test:
self.daemon.kill() self.daemon.kill()
finally: finally:
self.daemon = None self.daemon = None
self.cmdsock.close()
def append(self, testcase): def append(self, testcase):
"""Add one testcase to the test case list""" """Add one testcase to the test case list"""