From c4ca2ab4b9637953a2734e14b208aaa08f0e8574 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 17 May 2018 16:03:57 -0400 Subject: [PATCH] pytest: Fix the benchmark script Signed-off-by: Christian Decker --- tests/benchmark.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/benchmark.py b/tests/benchmark.py index aa9c89386..89b716d86 100644 --- a/tests/benchmark.py +++ b/tests/benchmark.py @@ -23,14 +23,11 @@ def executor(): def bitcoind(): bitcoind = utils.BitcoinD(rpcport=28332) bitcoind.start() - info = bitcoind.rpc.getinfo() + info = bitcoind.rpc.getblockchaininfo() # Make sure we have segwit and some funds if info['blocks'] < 432: logging.debug("SegWit not active, generating some more blocks") bitcoind.generate_block(432 - info['blocks']) - elif info['balance'] < 1: - logging.debug("Insufficient balance, generating 1 block") - bitcoind.generate_block(1) yield bitcoind @@ -43,16 +40,16 @@ def bitcoind(): @pytest.fixture def node_factory(request, bitcoind, executor): - nf = NodeFactory(request.node.name, bitcoind, executor) + nf = NodeFactory(request.node.name, bitcoind, executor, directory="/dev/shm/lightning-tests") yield nf - nf.killall() + nf.killall([False]*len(nf.nodes)) def test_single_hop(node_factory, executor): l1 = node_factory.get_node() l2 = node_factory.get_node() - l1.rpc.connect(l2.rpc.getinfo()['id'], 'localhost:%d' % l2.rpc.getinfo()['port']) + l1.rpc.connect(l2.rpc.getinfo()['id'], 'localhost:%d' % l2.port) l1.openchannel(l2, 4000000) print("Collecting invoices")