From 7a6fd700781688ab451ebfc6671e864ec545fbd1 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sat, 27 Nov 2021 20:44:51 +1030 Subject: [PATCH] pytest: Reduce memory consumption by test_plugin_disable It runs 6 nodes: under valgrind this ends up consuming 5.3 GB RSS. By stopping nodes between, we peak about 1G RSS. Measured using: (while true; do echo $(for i in 4 5 6; do ps uh | tr -s ' ' | cut -d\ -f$i | tally; done); sleep 5; done)& (Which measures my other processes as well, but that's only about 100M). Signed-off-by: Rusty Russell --- tests/test_plugin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index c8eeff434..ce8476f8f 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -282,6 +282,7 @@ def test_plugin_disable(node_factory): with pytest.raises(RpcError): n.rpc.hello(name='Sun') assert n.daemon.is_in_log('helloworld.py: disabled via disable-plugin') + n.stop() # Also works by basename. n = node_factory.get_node(options=OrderedDict([('plugin-dir', plugin_dir), @@ -290,6 +291,7 @@ def test_plugin_disable(node_factory): with pytest.raises(RpcError): n.rpc.hello(name='Sun') assert n.daemon.is_in_log('helloworld.py: disabled via disable-plugin') + n.stop() # Other order also works! n = node_factory.get_node(options=OrderedDict([('disable-plugin', @@ -298,6 +300,7 @@ def test_plugin_disable(node_factory): with pytest.raises(RpcError): n.rpc.hello(name='Sun') assert n.daemon.is_in_log('helloworld.py: disabled via disable-plugin') + n.stop() # Both orders of explicit specification work. n = node_factory.get_node(options=OrderedDict([('disable-plugin', @@ -308,6 +311,7 @@ def test_plugin_disable(node_factory): with pytest.raises(RpcError): n.rpc.hello(name='Sun') assert n.daemon.is_in_log('helloworld.py: disabled via disable-plugin') + n.stop() # Both orders of explicit specification work. n = node_factory.get_node(options=OrderedDict([('plugin', @@ -322,6 +326,7 @@ def test_plugin_disable(node_factory): # Still disabled if we load directory. n.rpc.plugin_startdir(directory=os.path.join(os.getcwd(), "contrib/plugins")) n.daemon.wait_for_log('helloworld.py: disabled via disable-plugin') + n.stop() # Check that list works n = node_factory.get_node(options={'disable-plugin':