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

Function test_plugin_slowinit

tests/test_plugin.py:243–254  ·  view source on GitHub ↗

Tests that the 'plugin' RPC command times out if plugin doesnt respond

(node_factory)

Source from the content-addressed store, hash-verified

241
242
243def test_plugin_slowinit(node_factory):
244 """Tests that the 'plugin' RPC command times out if plugin doesnt respond"""
245 os.environ['SLOWINIT_TIME'] = '121'
246 n = node_factory.get_node()
247
248 with pytest.raises(RpcError, match=': timed out before replying to init'):
249 n.rpc.plugin_start(os.path.join(os.getcwd(), "tests/plugins/slow_init.py"))
250
251 # It's not actually configured yet, see what happens;
252 # make sure 'rescan' and 'list' controls dont crash
253 n.rpc.plugin_rescan()
254 n.rpc.plugin_list()
255
256
257def test_plugin_command(node_factory):

Callers

nothing calls this directly

Calls 5

plugin_startMethod · 0.80
joinMethod · 0.80
plugin_rescanMethod · 0.80
plugin_listMethod · 0.80
get_nodeMethod · 0.45

Tested by

no test coverage detected