mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
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>
This commit is contained in:
committed by
Rusty Russell
parent
d6f441bdf4
commit
1643a61499
@@ -284,11 +284,11 @@ class TailableProc(object):
|
|||||||
if self.is_in_log(r):
|
if self.is_in_log(r):
|
||||||
print("({} was previously in logs!)".format(r))
|
print("({} was previously in logs!)".format(r))
|
||||||
raise TimeoutError('Unable to find "{}" in logs.'.format(exs))
|
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:
|
with self.logs_cond:
|
||||||
if pos >= len(self.logs):
|
if pos >= len(self.logs):
|
||||||
|
if not self.running:
|
||||||
|
raise ValueError('Process died while waiting for logs')
|
||||||
self.logs_cond.wait(1)
|
self.logs_cond.wait(1)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user