Skip to content

Commit 1ad72fd

Browse files
committed
pytest: fix test_xpay flake.
``` > assert len(layers['layers']) == 1 E AssertionError: assert 2 == 1 E + where 2 = len([{'layer': 'xpay', 'persistent': True, 'disabled_nodes': [], 'created_channels': [], 'channel_updates': [], 'constraints': [{'short_channel_id_dir': '45210x2134x44171/0', 'timestamp': 1770341134, 'minimum_msat': 289153519}, {'short_channel_id_dir': '1895x7x1895/1', 'timestamp': 1770341134, 'minimum_msat': 289007015}, {'short_channel_id_dir': '1906x1039x1906/1', 'timestamp': 1770341134, 'minimum_msat': 289008304}, {'short_channel_id_dir': '10070x60x10063/1', 'timestamp': 1770341134, 'minimum_msat': 289005726}, {'short_channel_id_dir': '18772x60x18743/0', 'timestamp': 1770341134, 'minimum_msat': 289005726}, {'short_channel_id_dir': '18623x208x18594/0', 'timestamp': 1770341134, 'minimum_msat': 289004859}, {'short_channel_id_dir': '33935x826x33727/1', 'timestamp': 1770341134, 'maximum_msat': 491501488}], 'biases': [], 'node_biases': []}, {'layer': 'xpay-94', 'persistent': False, 'disabled_nodes': [], 'created_channels': [], 'channel_updates': [], 'constraints': [], 'biases': [], 'node_biases': []}]) ``` Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent 2a5fbd1 commit 1ad72fd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/test_xpay.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,12 @@ def test_xpay_fake_channeld(node_factory, bitcoind, chainparams, slow_mode):
281281
# Should be no reservations left (clean up happens after return though)
282282
wait_for(lambda: l1.rpc.askrene_listreservations() == {'reservations': []})
283283

284+
# Wait for temporary layers to be gone too.
285+
wait_for(lambda: len(l1.rpc.askrene_listlayers()['layers']) == 1)
286+
284287
# It should remember the information it learned across restarts!
285288
# FIXME: channeld_fakenet doesn't restart properly, so just redo xpay.
286289
layers = l1.rpc.askrene_listlayers()
287-
# Temporary layers should be gone.
288-
assert len(layers['layers']) == 1
289-
290290
l1.rpc.plugin_stop("cln-askrene")
291291
l1.rpc.plugin_start(os.path.join(os.getcwd(), 'plugins/cln-askrene'))
292292
layers_after = l1.rpc.askrene_listlayers()

0 commit comments

Comments
 (0)