Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge with upstream #10

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 2 additions & 29 deletions tests/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
from tqdm import tqdm


import logging
import pytest
import random
import utils


num_workers = 480
Expand All @@ -21,25 +19,6 @@ def executor():
ex.shutdown(wait=False)


@pytest.fixture(scope="module")
def bitcoind():
bitcoind = utils.BitcoinD(rpcport=28332)
bitcoind.start()
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'])

yield bitcoind

try:
bitcoind.rpc.stop()
except Exception:
bitcoind.proc.kill()
bitcoind.proc.wait()


def test_single_hop(node_factory, executor):
l1 = node_factory.get_node()
l2 = node_factory.get_node()
Expand Down Expand Up @@ -73,10 +52,7 @@ def do_pay(i):


def test_single_payment(node_factory, benchmark):
l1 = node_factory.get_node()
l2 = node_factory.get_node()
l1.rpc.connect(l2.rpc.getinfo()['id'], 'localhost:%d' % l2.port)
l1.openchannel(l2, 4000000)
l1, l2 = node_factory.line_graph(2)

def do_pay(l1, l2):
invoice = l2.rpc.invoice(1000, 'invoice-{}'.format(random.random()), 'desc')['bolt11']
Expand All @@ -95,10 +71,7 @@ def bench_invoice():


def test_pay(node_factory, benchmark):
l1 = node_factory.get_node()
l2 = node_factory.get_node()
l1.rpc.connect(l2.rpc.getinfo()['id'], 'localhost:%d' % l2.port)
l1.openchannel(l2, 4000000)
l1, l2 = node_factory.line_graph(2)

invoices = []
for _ in range(1, 100):
Expand Down
2 changes: 2 additions & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ pytest-xdist==1.22.2
flaky==3.4.0
CherryPy==17.3.0
Flask==1.0.2
pytest-benchmark==3.1.1
tqdm==4.26.0
4 changes: 2 additions & 2 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,8 +947,8 @@ def check_new_log():
wait_for(check_new_log)


@unittest.skipIf(VALGRIND and not DEVELOPER,
"Backtrace upsets valgrind: only suppressed in DEVELOPER mode")
@unittest.skipIf(VALGRIND,
"Valgrind sometimes fails assert on injected SEGV")
def test_crashlog(node_factory):
l1 = node_factory.get_node(may_fail=True)

Expand Down