From 3def5393d8f5d96458a5dad6dcc77cd7fa8de4d8 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 9 Dec 2019 15:32:21 +0100 Subject: [PATCH] pytest: Stabilize the hsm_encryption test Tailing the log when we expect the process to exit can be racy (in this case we were waiting for the last line that'd be printed). --- tests/test_wallet.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_wallet.py b/tests/test_wallet.py index 8f1ec9054..01f496894 100644 --- a/tests/test_wallet.py +++ b/tests/test_wallet.py @@ -595,7 +595,8 @@ def test_hsm_secret_encryption(node_factory): wait_for_initialized=False) l1.daemon.wait_for_log(r'The hsm_secret is encrypted') os.write(master_fd, password[2:].encode("utf-8")) - l1.daemon.wait_for_log("Wrong password for encrypted hsm_secret.") + assert(l1.daemon.proc.wait() == 1) + assert(l1.daemon.is_in_log("Wrong password for encrypted hsm_secret.")) # Test we can restore the same wallet with the same password l1.daemon.start(stdin=slave_fd, wait_for_initialized=False)