mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pytest: make test_plugin_slowinit a test again
This commit is contained in:
@@ -8,7 +8,7 @@ plugin = Plugin()
|
|||||||
@plugin.init()
|
@plugin.init()
|
||||||
def init(options, configuration, plugin):
|
def init(options, configuration, plugin):
|
||||||
plugin.log("slow_init.py initializing {}".format(configuration))
|
plugin.log("slow_init.py initializing {}".format(configuration))
|
||||||
time.sleep(2)
|
time.sleep(11)
|
||||||
|
|
||||||
|
|
||||||
plugin.run()
|
plugin.run()
|
||||||
|
|||||||
@@ -97,7 +97,8 @@ def test_plugin_slowinit(node_factory):
|
|||||||
"""Tests that the 'plugin' RPC command times out if plugin doesnt respond"""
|
"""Tests that the 'plugin' RPC command times out if plugin doesnt respond"""
|
||||||
n = node_factory.get_node()
|
n = node_factory.get_node()
|
||||||
|
|
||||||
n.rpc.plugin_start(os.path.join(os.getcwd(), "tests/plugins/slow_init.py"))
|
with pytest.raises(RpcError, match="Timed out while waiting for plugin response"):
|
||||||
|
n.rpc.plugin_start(os.path.join(os.getcwd(), "tests/plugins/slow_init.py"))
|
||||||
|
|
||||||
# It's not actually configured yet, see what happens;
|
# It's not actually configured yet, see what happens;
|
||||||
# make sure 'rescan' and 'list' controls dont crash
|
# make sure 'rescan' and 'list' controls dont crash
|
||||||
|
|||||||
Reference in New Issue
Block a user