Browse Source

pytest: fix race in test_closing_different_fees

We got an index error, because status had only one field (onchaind not
started yet).

    >   wait_for(lambda: only_one(p.rpc.listpeers(l1.info['id'])['peers'][0]['channels'])['status'][1] == 'ONCHAIN:Tracking mutual close transaction')
    E   IndexError: list index out of range1

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 6 years ago
committed by Christian Decker
parent
commit
bc7ca34a38
  1. 3
      tests/test_closing.py

3
tests/test_closing.py

@ -244,7 +244,8 @@ def test_closing_different_fees(node_factory, bitcoind, executor):
bitcoind.generate_block(1) bitcoind.generate_block(1)
for p in peers: for p in peers:
p.daemon.wait_for_log(' to ONCHAIN') p.daemon.wait_for_log(' to ONCHAIN')
wait_for(lambda: only_one(p.rpc.listpeers(l1.info['id'])['peers'][0]['channels'])['status'][1] == 'ONCHAIN:Tracking mutual close transaction') wait_for(lambda: 'ONCHAIN:Tracking mutual close transaction' in only_one(p.rpc.listpeers(l1.info['id'])['peers'][0]['channels'])['status'])
l1.daemon.wait_for_logs([' to ONCHAIN'] * num_peers) l1.daemon.wait_for_logs([' to ONCHAIN'] * num_peers)

Loading…
Cancel
Save