Due to a merge conflict, this is now based on #10267. Please review that PR first!
Subset of #12379 now that parts of that PR have been merged.
#12362 was only observed when running the functional tests locally because:
- by defatul libc logs to
/dev/tty
instead of stderr - the functional tests only check for substring inclusion in stderr when we’re expecting bitcoind to fail.
This PR tightens our checking of stderr and will cause tests to fail if there is any unexpected message in stderr:
- commit Write stdout/stderr to datadir instead of temp file writes stderr to a file in the datadir instead of a temporary file. This helps with debugging in the case of failure.
- commit Use LIBC_FATAL_STDERR=1 in tests ensures that libc failures are logged to stderr instead of the terminal. commit Assert that bitcoind stdout is empty on shutdown asserts that stderr is empty on bitcoind shutdown.