summary: makes test_summary_persist more precise

This commit is contained in:
Michael Schmoock
2021-06-24 12:41:12 +02:00
parent 37022fbc15
commit 2afe310a6e
2 changed files with 4 additions and 4 deletions

View File

@@ -1,8 +1,7 @@
from datetime import datetime
# ensure an rpc peer is added
def addpeer(p, rpcpeer):
pid = rpcpeer['id']
if pid not in p.persist['peerstate']:

View File

@@ -180,8 +180,9 @@ def test_summary_persist(node_factory):
# when
l1.daemon.wait_for_log(r".*availability persisted and synced.*")
s1 = l1.rpc.summary()
l2.stop()
l1.restart()
l1.connect(l2)
assert l1.daemon.is_in_log(r".*Reopened summary.dat shelve.*")
l1.daemon.logsearch_start = len(l1.daemon.logs)
l1.daemon.wait_for_log(r".*availability persisted and synced.*")
s2 = l1.rpc.summary()
@@ -190,7 +191,7 @@ def test_summary_persist(node_factory):
avail1 = int(re.search(' ([0-9]*)% ', s1['channels'][2]).group(1))
avail2 = int(re.search(' ([0-9]*)% ', s2['channels'][2]).group(1))
assert(avail1 == 100)
assert(avail2 > 0)
assert(0 < avail2 < 100)
def test_summary_start(node_factory):