mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
pytest: dev env var LIGHTNINGD_DEV_LOG_IO turns io logging on immediately.
This is required for the next test, which has to log messages from channeld as soon as it starts (so might be too late if it sends SIGUSR1). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
ebaf5eaf2e
commit
9f044305db
@@ -36,6 +36,9 @@ static void setup_logging_sighandler(void)
|
|||||||
|
|
||||||
void status_setup_sync(int fd)
|
void status_setup_sync(int fd)
|
||||||
{
|
{
|
||||||
|
#if DEVELOPER
|
||||||
|
logging_io = (getenv("LIGHTNINGD_DEV_LOG_IO") != NULL);
|
||||||
|
#endif
|
||||||
assert(status_fd == -1);
|
assert(status_fd == -1);
|
||||||
assert(!status_conn);
|
assert(!status_conn);
|
||||||
status_fd = fd;
|
status_fd = fd;
|
||||||
@@ -44,6 +47,9 @@ void status_setup_sync(int fd)
|
|||||||
|
|
||||||
void status_setup_async(struct daemon_conn *master)
|
void status_setup_async(struct daemon_conn *master)
|
||||||
{
|
{
|
||||||
|
#if DEVELOPER
|
||||||
|
logging_io = (getenv("LIGHTNINGD_DEV_LOG_IO") != NULL);
|
||||||
|
#endif
|
||||||
assert(status_fd == -1);
|
assert(status_fd == -1);
|
||||||
assert(!status_conn);
|
assert(!status_conn);
|
||||||
status_conn = master;
|
status_conn = master;
|
||||||
|
|||||||
@@ -684,7 +684,7 @@ class NodeFactory(object):
|
|||||||
|
|
||||||
return [j.result() for j in jobs]
|
return [j.result() for j in jobs]
|
||||||
|
|
||||||
def get_node(self, disconnect=None, options=None, may_fail=False, may_reconnect=False, random_hsm=False, feerates=(15000, 7500, 3750), start=True):
|
def get_node(self, disconnect=None, options=None, may_fail=False, may_reconnect=False, random_hsm=False, feerates=(15000, 7500, 3750), start=True, fake_bitcoin_cli=False, log_all_io=False):
|
||||||
with self.lock:
|
with self.lock:
|
||||||
node_id = self.next_id
|
node_id = self.next_id
|
||||||
self.next_id += 1
|
self.next_id += 1
|
||||||
@@ -707,6 +707,10 @@ class NodeFactory(object):
|
|||||||
with open(daemon.disconnect_file, "w") as f:
|
with open(daemon.disconnect_file, "w") as f:
|
||||||
f.write("\n".join(disconnect))
|
f.write("\n".join(disconnect))
|
||||||
daemon.opts["dev-disconnect"] = "dev_disconnect"
|
daemon.opts["dev-disconnect"] = "dev_disconnect"
|
||||||
|
if log_all_io:
|
||||||
|
assert DEVELOPER
|
||||||
|
daemon.env["LIGHTNINGD_DEV_LOG_IO"] = "1"
|
||||||
|
daemon.opts["log-level"] = "io"
|
||||||
if DEVELOPER:
|
if DEVELOPER:
|
||||||
daemon.opts["dev-fail-on-subdaemon-fail"] = None
|
daemon.opts["dev-fail-on-subdaemon-fail"] = None
|
||||||
daemon.env["LIGHTNINGD_DEV_MEMLEAK"] = "1"
|
daemon.env["LIGHTNINGD_DEV_MEMLEAK"] = "1"
|
||||||
|
|||||||
Reference in New Issue
Block a user