From 40dfbcc1247d44d13b32bf0a2c19c95a6a58d4d8 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 16 May 2025 21:34:23 +0930 Subject: [PATCH] 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 --- tests/test_opening.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/test_opening.py b/tests/test_opening.py index e3b1c72a3..7c086dc7c 100644 --- a/tests/test_opening.py +++ b/tests/test_opening.py @@ -577,10 +577,6 @@ def test_v2_rbf_liquidity_ad(node_factory, bitcoind, chainparams): l1, l2 = node_factory.get_nodes(2, opts=opts) - # Other plugins use datastore, but we want to make sure our own - # data is cleared! - empty_datastore = l1.rpc.listdatastore() - # what happens when we RBF? feerate = 2000 amount = 500000 @@ -637,7 +633,7 @@ def test_v2_rbf_liquidity_ad(node_factory, bitcoind, chainparams): l1.rpc.openchannel_signed(chan_id, signed_psbt) # There's data in the datastore now (l2 only) - assert l1.rpc.listdatastore() == empty_datastore + assert l1.rpc.listdatastore(['funder']) == {'datastore': []} only_one(l2.rpc.listdatastore("funder/{}".format(chan_id))['datastore']) # what happens when the channel opens? @@ -645,8 +641,8 @@ def test_v2_rbf_liquidity_ad(node_factory, bitcoind, chainparams): l1.daemon.wait_for_log('to CHANNELD_NORMAL') # Datastore should be cleaned up! - assert l1.rpc.listdatastore() == empty_datastore - wait_for(lambda: l2.rpc.listdatastore() == empty_datastore) + assert l1.rpc.listdatastore(['funder']) == {'datastore': []} + wait_for(lambda: l2.rpc.listdatastore(['funder']) == {'datastore': []}) # This should be the accepter's amount fundings = only_one(l1.rpc.listpeerchannels()['channels'])['funding']