(node_factory)
| 699 | |
| 700 | |
| 701 | def 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 | |
| 737 | def test_privatechan(node_factory, bitcoind): |
nothing calls this directly
no test coverage detected