MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_concurrency

Function test_concurrency

tests/test_renepay.py:701–734  ·  view source on GitHub ↗
(node_factory)

Source from the content-addressed store, hash-verified

699
700
701def test_concurrency(node_factory):
702 l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True, opts={'allow-deprecated-apis': True})
703 inv = l3.rpc.invoice("1000sat", "test_renepay", "description")["bolt11"]
704 p1 = subprocess.Popen(
705 [
706 "cli/lightning-cli",
707 "--network={}".format(TEST_NETWORK),
708 "--lightning-dir={}".format(l1.daemon.lightning_dir),
709 "-k",
710 "renepay",
711 "invstring={}".format(inv),
712 ],
713 stdout=subprocess.PIPE,
714 )
715 # make several other spurious requests
716 for i in range(4):
717 subprocess.Popen(
718 [
719 "cli/lightning-cli",
720 "--network={}".format(TEST_NETWORK),
721 "--lightning-dir={}".format(l1.daemon.lightning_dir),
722 "-k",
723 "renepay",
724 "invstring={}".format(inv),
725 ],
726 stdout=subprocess.PIPE,
727 )
728 p1.wait(timeout=60)
729 # remove comments from the output before parsing the json
730 out1 = json.loads(re.sub("#.*?\n", "", p1.stdout.read().decode()))
731 assert out1["status"] == "complete"
732 assert out1["amount_msat"] == Millisatoshi("1000sat")
733 invoice = only_one(l3.rpc.listinvoices("test_renepay")["invoices"])
734 assert invoice["amount_received_msat"] >= Millisatoshi("1000sat")
735
736
737def test_privatechan(node_factory, bitcoind):

Callers

nothing calls this directly

Calls 9

MillisatoshiClass · 0.90
only_oneFunction · 0.90
line_graphMethod · 0.80
subMethod · 0.80
invoiceMethod · 0.45
waitMethod · 0.45
decodeMethod · 0.45
readMethod · 0.45
listinvoicesMethod · 0.45

Tested by

no test coverage detected