libplugin: plugin_exit helper which flushes stdout.

We weren't actually getting the last log out; this does that.

We have to fix test_bitcoin_failure which now notices the BROKEN
log message.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: libplugin: Fatal error messages from plugin_exit() now logged in lightningd.
This commit is contained in:
Rusty Russell
2021-09-03 19:46:20 +09:30
committed by Christian Decker
parent 1d8aecb44f
commit 2063049559
3 changed files with 28 additions and 3 deletions

View File

@@ -134,11 +134,16 @@ def test_bitcoin_failure(node_factory, bitcoind):
bitcoind.cmd_line += ["-blocksonly"]
bitcoind.start()
l2 = node_factory.get_node(start=False, expect_fail=True)
# Ignore BROKEN log message about blocksonly mode.
l2 = node_factory.get_node(start=False, expect_fail=True,
allow_broken_log=True)
with pytest.raises(ValueError):
l2.start(stderr=subprocess.PIPE)
assert l2.daemon.is_in_stderr(r".*deactivating transaction relay is not"
" supported.") is not None
# wait_for_log gets upset since daemon is not running.
wait_for(lambda: l2.daemon.is_in_log('deactivating transaction'
' relay is not supported'))
def test_bitcoin_ibd(node_factory, bitcoind):