(WIP because if we’re not careful this could result in a lot of false +ves. Should be tested on different platforms to verify portability).
#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 rename TestNode to TestP2PConn in tests is not necessary in this PR, but it removes a name conflict in the functional tests (which makes it difficult to see all the places that
TestNode
is being called) - commit Move assert_start_raises_init_error method to TestNode moves a method from test_framework to test_node (in general, methods which only affect a single node should be methods in
TestNode
). - 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 Update assert_start_raises_init_eror() to test for an exact m… changes
assert_start_raises_init_eror()
to match on an exact regex instead of a substring (with due apologies to @laanwj for #12302). - commit Assert that bitcoind stdout is empty on shutdown asserts that stderr is empty on bitcoind shutdown.