Skip to content

Commit

Permalink
pytest: fix race in test_multichan
Browse files Browse the repository at this point in the history
We can fail to use larger channel if it's not ready yet:

```
2022-05-23T01:20:05.5325600Z         # Check it used the larger channel!
2022-05-23T01:20:05.5326376Z >       assert before[chan23a_idx]['to_us_msat'] == after[chan23a_idx]['to_us_msat']
2022-05-23T01:20:05.5326961Z E       assert 1000000000msat == 900000000msat
2022-05-23T01:20:05.5327240Z 
2022-05-23T01:20:05.5327621Z tests/test_connection.py:3896: AssertionError
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed May 23, 2022
1 parent 69dec6f commit 25eb4c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -3849,6 +3849,8 @@ def test_multichan(node_factory, executor, bitcoind):
assert(len(only_one(l3.rpc.listpeers(l2.info['id'])['peers'])['channels']) == 2)

bitcoind.generate_block(1, wait_for_mempool=1)
# Make sure new channel is also CHANNELD_NORMAL
wait_for(lambda: [c['state'] for c in only_one(l2.rpc.listpeers(l3.info['id'])['peers'])['channels']] == ["CHANNELD_NORMAL", "CHANNELD_NORMAL"])

# Dance around to get the *other* scid.
wait_for(lambda: all(['short_channel_id' in c for c in l3.rpc.listpeers()['peers'][0]['channels']]))
Expand Down

0 comments on commit 25eb4c8

Please sign in to comment.