From 989d5a545ab877fb992c2232c47f98b234e38186 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Mon, 12 Mar 2018 17:21:03 +0100 Subject: [PATCH] tests: don't crash if lldpd crashed Otherwise, we don't get the appropriate information! --- tests/integration/fixtures/programs.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/integration/fixtures/programs.py b/tests/integration/fixtures/programs.py index 8f91db58..63f7e1a2 100644 --- a/tests/integration/fixtures/programs.py +++ b/tests/integration/fixtures/programs.py @@ -168,12 +168,18 @@ class LldpdFactory(object): def killall(self): for p in self.pids[:]: - os.kill(p, signal.SIGTERM) + try: + os.kill(p, signal.SIGTERM) + except ProcessLookupError: + continue for t in self.threads: if t.is_alive(): t.join(1) for p in self.pids[:]: - os.kill(p, signal.SIGKILL) + try: + os.kill(p, signal.SIGKILL) + except ProcessLookupError: + continue for t in self.threads: if t.is_alive(): t.join(1) -- 2.39.5