core-lightning/tests/plugins/slow_init.py
Rusty Russell 006ab1e367 pytest: test loading all plugins at once, including failing ones.
We modify the slow_init() so it doesn't go too slowly for this test.

This demonstrates a crash, where we currently try to fail a command
multiple times.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-05-05 13:45:17 +09:30

16 lines
291 B
Python
Executable File

#!/usr/bin/env python3
from pyln.client import Plugin
import os
import time
plugin = Plugin()
@plugin.init()
def init(options, configuration, plugin):
plugin.log("slow_init.py initializing {}".format(configuration))
time.sleep(int(os.getenv('SLOWINIT_TIME', "0")))
plugin.run()