Skip to content

Commit 3a0e3a1

Browse files
committed
pytest: fix test in test_gossip_pruning
It's possible that listchannels doesn't show the channel yet: ``` l1.rpc.connect(l2.info['id'], 'localhost', l2.port) l2.rpc.connect(l3.info['id'], 'localhost', l3.port) scid1, _ = l1.fundchannel(l2, 10**6) scid2, _ = l2.fundchannel(l3, 10**6) mine_funding_to_announce(bitcoind, [l1, l2, l3]) > l1_initial_cupdate_timestamp = only_one(l1.rpc.listchannels(source=l1.info['id'])['channels'])['last_update'] tests/test_gossip.py:43: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ arr = [] def only_one(arr): """Many JSON RPC calls return an array; often we only expect a single entry """ > assert len(arr) == 1 E AssertionError ``` Signed-off-by: Rusty Russell <[email protected]>
1 parent e998a72 commit 3a0e3a1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/test_gossip.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def test_gossip_pruning(node_factory, bitcoind):
4040
scid2, _ = l2.fundchannel(l3, 10**6)
4141

4242
mine_funding_to_announce(bitcoind, [l1, l2, l3])
43+
wait_for(lambda: l1.rpc.listchannels(source=l1.info['id'])['channels'] != [])
4344
l1_initial_cupdate_timestamp = only_one(l1.rpc.listchannels(source=l1.info['id'])['channels'])['last_update']
4445

4546
# Get timestamps of initial updates, so we can ensure they change.

0 commit comments

Comments
 (0)