From c0ae3cb8c426727979c78150a79ffb65cf5b40d8 Mon Sep 17 00:00:00 2001 From: darosior Date: Fri, 11 Oct 2019 13:30:25 +0200 Subject: [PATCH] pytest: make test_plugin_slowinit a test again --- tests/plugins/slow_init.py | 2 +- tests/test_plugin.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/plugins/slow_init.py b/tests/plugins/slow_init.py index 91945d7df..48c279047 100755 --- a/tests/plugins/slow_init.py +++ b/tests/plugins/slow_init.py @@ -8,7 +8,7 @@ plugin = Plugin() @plugin.init() def init(options, configuration, plugin): plugin.log("slow_init.py initializing {}".format(configuration)) - time.sleep(2) + time.sleep(11) plugin.run() diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 53e9474df..b1e6ef84c 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -97,7 +97,8 @@ def test_plugin_slowinit(node_factory): """Tests that the 'plugin' RPC command times out if plugin doesnt respond""" 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; # make sure 'rescan' and 'list' controls dont crash