From 60064678249f85fc89163a4f510dfca5758746d2 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 20 Nov 2025 12:07:12 +1030 Subject: [PATCH] pytest: increase test_generate_coinmoves to 2M entries. Now we've rid ourselves of the worst offenders, we can make this a real stress test. We remove plugin io saving and low-level logging, to avoid benchmarking testing artifacts. Here are the results: tests/test_coinmoves.py::test_generate_coinmoves (2,000,000, sqlite3): Time (from start to end of l2 node): 518 seconds Worst latency: 353 seconds tests/test_coinmoves.py::test_generate_coinmoves (2,000,000, Postgres): Time (from start to end of l2 node): 417 seconds Worst latency: 96.6 seconds Signed-off-by: Rusty Russell --- tests/test_coinmoves.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_coinmoves.py b/tests/test_coinmoves.py index 0eefdadd0..d9366cd6a 100644 --- a/tests/test_coinmoves.py +++ b/tests/test_coinmoves.py @@ -2093,7 +2093,7 @@ def test_migration_no_bkpr(node_factory, bitcoind): def test_generate_coinmoves(node_factory, bitcoind, executor): - l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True) + l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True, opts={'log-level': 'info'}) # Route some payments l1.rpc.xpay(l3.rpc.invoice(1, "test_generate_coinmoves", "test_generate_coinmoves")['bolt11']) @@ -2110,8 +2110,8 @@ def test_generate_coinmoves(node_factory, bitcoind, executor): next_timestamp = entries[-1]['timestamp'] + 1 batch = [] - # Let's make 100,000 entries. - for _ in range(100_000 // len(entries)): + # Let's make 2 million entries. + for _ in range(2_000_000 // len(entries)): # Random payment_hash entries[0]['payment_hash'] = entries[1]['payment_hash'] = random.randbytes(32) entries[2]['payment_hash'] = random.randbytes(32) @@ -2144,6 +2144,8 @@ def test_generate_coinmoves(node_factory, bitcoind, executor): # Memleak detection here creates significant overhead! del l2.daemon.env["LIGHTNINGD_DEV_MEMLEAK"] + # Don't bother recording all our io. + del l2.daemon.opts['dev-save-plugin-io'] l2.start() def measure_latency(node, stop_event):