Skip to content

Commit 1643a61

Browse files
darosiordanielabrozzoni
authored andcommitted
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 <daniela@revault.dev> Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
1 parent d6f441b commit 1643a61

File tree

1 file changed

+2
-2
lines changed
  • contrib/pyln-testing/pyln/testing

1 file changed

+2
-2
lines changed

contrib/pyln-testing/pyln/testing/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,11 @@ def wait_for_logs(self, regexs, timeout=TIMEOUT):
284284
if self.is_in_log(r):
285285
print("({} was previously in logs!)".format(r))
286286
raise TimeoutError('Unable to find "{}" in logs.'.format(exs))
287-
elif not self.running:
288-
raise ValueError('Process died while waiting for logs')
289287

290288
with self.logs_cond:
291289
if pos >= len(self.logs):
290+
if not self.running:
291+
raise ValueError('Process died while waiting for logs')
292292
self.logs_cond.wait(1)
293293
continue
294294

0 commit comments

Comments
 (0)