From: Vincent Bernat Date: Mon, 12 Mar 2018 16:21:03 +0000 (+0100) Subject: tests: don't crash if lldpd crashed X-Git-Tag: 1.0.0~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=989d5a545ab877fb992c2232c47f98b234e38186;p=thirdparty%2Flldpd.git tests: don't crash if lldpd crashed Otherwise, we don't get the appropriate information! --- 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)