From 1643a614997e88caf291b30135b44eee68623a52 Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Tue, 15 Jun 2021 15:09:59 +0200 Subject: [PATCH] pyln-testing: check if process died after having read all logs We would fail even if a process exited cleanly after having the line we were looking for, because we checked if it died before reading the logs. Co-Authored-by: Daniela Brozzoni Signed-off-by: Antoine Poinsot --- contrib/pyln-testing/pyln/testing/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/pyln-testing/pyln/testing/utils.py b/contrib/pyln-testing/pyln/testing/utils.py index a6e3e48c8..20288e58d 100644 --- a/contrib/pyln-testing/pyln/testing/utils.py +++ b/contrib/pyln-testing/pyln/testing/utils.py @@ -284,11 +284,11 @@ class TailableProc(object): if self.is_in_log(r): print("({} was previously in logs!)".format(r)) raise TimeoutError('Unable to find "{}" in logs.'.format(exs)) - elif not self.running: - raise ValueError('Process died while waiting for logs') with self.logs_cond: if pos >= len(self.logs): + if not self.running: + raise ValueError('Process died while waiting for logs') self.logs_cond.wait(1) continue