Skip to content

Commit

Permalink
summary: makes test_summary_persist more precise
Browse files Browse the repository at this point in the history
  • Loading branch information
m-schmoock committed Jun 24, 2021
1 parent 37022fb commit 2afe310
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions summary/summary_avail.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from datetime import datetime

# ensure an rpc peer is added


# ensure an rpc peer is added
def addpeer(p, rpcpeer):
pid = rpcpeer['id']
if pid not in p.persist['peerstate']:
Expand Down
5 changes: 3 additions & 2 deletions summary/test_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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):
Expand Down

0 comments on commit 2afe310

Please sign in to comment.