Skip to content

Commit dd23663

Browse files
committed
pytest: fix flake in test_coin_movement_notices
We restart the nodeL if the coin_movements.py plugin hasn't processed the notification yet, it will be incorrect: ``` > assert account_balance(l2, chanid_1) == 100001001 E AssertionError: assert 150_001_001msat == 100_001_001 E + where 150001001msat = account_balance(<fixtures.LightningNode object at 0x7f0634e1eb00>, '39ac52c818c5304cf0664940ff236c4e3f8f4ceb8993cb1491347142d61b62bc') ``` Signed-off-by: Rusty Russell <[email protected]>
1 parent c176e92 commit dd23663

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/test_plugin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,6 +2268,9 @@ def test_coin_movement_notices(node_factory, bitcoind, chainparams):
22682268
l2.rpc.sendpay(route, payment_hash21, payment_secret=inv['payment_secret'])
22692269
l2.rpc.waitsendpay(payment_hash21)
22702270

2271+
# Make sure coin_movements.py sees event before we restart!
2272+
l2.daemon.wait_for_log(f"plugin-coin_movements.py: coin movement: .*'payment_hash': '{payment_hash21}'")
2273+
22712274
# restart to test index
22722275
l2.restart()
22732276
wait_for(lambda: all(c['state'] == 'CHANNELD_NORMAL' for c in l2.rpc.listpeerchannels()["channels"]))

0 commit comments

Comments
 (0)