Test that we do not hang incoming HTLCs if the hook plugin crashes. Reproduces #3748.
(node_factory, executor)
| 2730 | |
| 2731 | |
| 2732 | def test_htlc_accepted_hook_crash(node_factory, executor): |
| 2733 | """Test that we do not hang incoming HTLCs if the hook plugin crashes. |
| 2734 | |
| 2735 | Reproduces #3748. |
| 2736 | """ |
| 2737 | plugin = os.path.join(os.getcwd(), 'tests/plugins/htlc_accepted-crash.py') |
| 2738 | l1 = node_factory.get_node() |
| 2739 | l2 = node_factory.get_node( |
| 2740 | options={'plugin': plugin}, |
| 2741 | broken_log='plugin-htlc_accepted-crash.py: Hook handler for htlc_accepted failed with an exception. Returning safe fallback response' |
| 2742 | ) |
| 2743 | l1.connect(l2) |
| 2744 | l1.fundchannel(l2) |
| 2745 | |
| 2746 | i = l2.rpc.invoice(500, "crashpls", "crashpls")['bolt11'] |
| 2747 | |
| 2748 | # This should still succeed |
| 2749 | |
| 2750 | f = executor.submit(l1.rpc.xpay, i) |
| 2751 | |
| 2752 | l2.daemon.wait_for_log(r'Crashing on purpose...') |
| 2753 | l2.daemon.wait_for_log( |
| 2754 | r'Hook handler for htlc_accepted failed with an exception.' |
| 2755 | ) |
| 2756 | |
| 2757 | with pytest.raises(RpcError, match=r'Unexpected error \(temporary_node_failure\) from final node: disabling'): |
| 2758 | f.result(TIMEOUT) |
| 2759 | |
| 2760 | |
| 2761 | def test_notify(node_factory): |
nothing calls this directly
no test coverage detected