mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 23:54:22 +01:00
pytest: Actually wait for payments to confirm in benchmark
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
committed by
Rusty Russell
parent
126f024cda
commit
dcbd27e7cf
@@ -40,7 +40,7 @@ def bitcoind():
|
|||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def node_factory(request, bitcoind, executor):
|
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
|
yield nf
|
||||||
nf.killall([False] * len(nf.nodes))
|
nf.killall([False] * len(nf.nodes))
|
||||||
|
|
||||||
@@ -62,10 +62,15 @@ def test_single_hop(node_factory, executor):
|
|||||||
print("Sending payments")
|
print("Sending payments")
|
||||||
start_time = time()
|
start_time = time()
|
||||||
|
|
||||||
for i in invoices:
|
def do_pay(i):
|
||||||
fs.append(executor.submit(l1.rpc.sendpay, route, 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()
|
f.result()
|
||||||
|
|
||||||
diff = time() - start_time
|
diff = time() - start_time
|
||||||
|
|||||||
Reference in New Issue
Block a user