test: test_invoices add a stress test

This commit is contained in:
Simon Vrouwe
2022-07-13 14:56:08 +03:00
committed by Rusty Russell
parent dbae5ae569
commit 94f16f14b7

View File

@@ -559,6 +559,7 @@ def test_waitanyinvoice_reversed(node_factory, executor):
assert r['label'] == 'inv1' assert r['label'] == 'inv1'
@pytest.mark.xfail(strict=True)
def test_autocleaninvoice(node_factory): def test_autocleaninvoice(node_factory):
l1 = node_factory.get_node() l1 = node_factory.get_node()
@@ -599,6 +600,13 @@ def test_autocleaninvoice(node_factory):
assert len(l1.rpc.listinvoices('inv1')['invoices']) == 0 assert len(l1.rpc.listinvoices('inv1')['invoices']) == 0
assert len(l1.rpc.listinvoices('inv2')['invoices']) == 0 assert len(l1.rpc.listinvoices('inv2')['invoices']) == 0
# stress test
l1.rpc.autocleaninvoice(cycle_seconds=0)
l1.rpc.autocleaninvoice(cycle_seconds=1)
l1.rpc.autocleaninvoice(cycle_seconds=0)
time.sleep(1)
l1.rpc.autocleaninvoice(cycle_seconds=1, expired_by=1)
def test_decode_unknown(node_factory): def test_decode_unknown(node_factory):
l1 = node_factory.get_node() l1 = node_factory.get_node()