Skip to content

Commit 40dfbcc

Browse files
committed
pytest: make test_v2_rbf_liquidity_ad more robust against other datastore users.
When peer backup is enabled by default, it puts things in the datastore, breaking this assumption. Narrow the test to examine the specific funder directory. Signed-off-by: Rusty Russell <[email protected]>
1 parent 49ccb0e commit 40dfbcc

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

tests/test_opening.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -577,10 +577,6 @@ def test_v2_rbf_liquidity_ad(node_factory, bitcoind, chainparams):
577577

578578
l1, l2 = node_factory.get_nodes(2, opts=opts)
579579

580-
# Other plugins use datastore, but we want to make sure our own
581-
# data is cleared!
582-
empty_datastore = l1.rpc.listdatastore()
583-
584580
# what happens when we RBF?
585581
feerate = 2000
586582
amount = 500000
@@ -637,16 +633,16 @@ def test_v2_rbf_liquidity_ad(node_factory, bitcoind, chainparams):
637633
l1.rpc.openchannel_signed(chan_id, signed_psbt)
638634

639635
# There's data in the datastore now (l2 only)
640-
assert l1.rpc.listdatastore() == empty_datastore
636+
assert l1.rpc.listdatastore(['funder']) == {'datastore': []}
641637
only_one(l2.rpc.listdatastore("funder/{}".format(chan_id))['datastore'])
642638

643639
# what happens when the channel opens?
644640
bitcoind.generate_block(6)
645641
l1.daemon.wait_for_log('to CHANNELD_NORMAL')
646642

647643
# Datastore should be cleaned up!
648-
assert l1.rpc.listdatastore() == empty_datastore
649-
wait_for(lambda: l2.rpc.listdatastore() == empty_datastore)
644+
assert l1.rpc.listdatastore(['funder']) == {'datastore': []}
645+
wait_for(lambda: l2.rpc.listdatastore(['funder']) == {'datastore': []})
650646

651647
# This should be the accepter's amount
652648
fundings = only_one(l1.rpc.listpeerchannels()['channels'])['funding']

0 commit comments

Comments
 (0)