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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2021-11-27 20:44:51 +10:30 committed by ZmnSCPxj, ZmnSCPxj jxPCSmnZ
parent c1f534a159
commit 7a6fd70078

View File

@ -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':