diff --git a/test/zdtm.py b/test/zdtm.py index bc14e3f73e..d9aaa5e956 100755 --- a/test/zdtm.py +++ b/test/zdtm.py @@ -507,8 +507,14 @@ def kill(self, sig=signal.SIGKILL): self.__freezer.thaw() if self.__pid: print("Send the %d signal to %s" % (sig, self.__pid)) - os.kill(int(self.__pid), sig) - self.gone(sig == signal.SIGKILL) + try: + os.kill(int(self.__pid), sig) + except ProcessLookupError: + # Prevent gone() calling waitpid(). + self.auto_reap = True + self.gone(True) + else: + self.gone(sig == signal.SIGKILL) self.__flavor.fini()