From dcbd27e7cfc2f5a6bfd973f071e1e4221ad7107e Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Fri, 18 May 2018 09:08:58 -0400 Subject: [PATCH] pytest: Actually wait for payments to confirm in benchmark Signed-off-by: Christian Decker --- tests/benchmark.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/benchmark.py b/tests/benchmark.py index 0a8980894..971eee87d 100644 --- a/tests/benchmark.py +++ b/tests/benchmark.py @@ -40,7 +40,7 @@ def bitcoind(): @pytest.fixture def node_factory(request, bitcoind, executor): - nf = NodeFactory(request.node.name, bitcoind, executor, directory="/dev/shm/lightning-tests") + nf = NodeFactory(request.node.name, bitcoind, executor) yield nf nf.killall([False] * len(nf.nodes)) @@ -62,10 +62,15 @@ def test_single_hop(node_factory, executor): print("Sending payments") start_time = time() - for i in invoices: - fs.append(executor.submit(l1.rpc.sendpay, route, i)) + def do_pay(i): + p = l1.rpc.sendpay(route, i) + r = l1.rpc.waitsendpay(p['payment_hash']) + return r - for f in tqdm(fs): + for i in invoices: + fs.append(executor.submit(do_pay, i)) + + for f in tqdm(futures.as_completed(fs), total=len(fs)): f.result() diff = time() - start_time