This PR adds a wait_for_cookie_credentials()
method to the test framework and calls it before the -rpcwait
tests, to avoid an intermittent race condition on the CI run with Valgrind where the cookie file isn’t written yet when the CLI call with -rpcwait
arrives to get_auth_cookie()
.
To reproduce/test, build with
0diff --git a/src/httprpc.cpp b/src/httprpc.cpp
1index 60c4d06f12..3dd06c4758 100644
2--- a/src/httprpc.cpp
3+++ b/src/httprpc.cpp
4@@ -291,6 +291,7 @@ static bool InitRPCAuthentication()
5 bool StartHTTPRPC()
6 {
7 LogPrint(BCLog::RPC, "Starting HTTP RPC server\n");
8+ UninterruptibleSleep(std::chrono::seconds{11});
9 if (!InitRPCAuthentication())
then run the test normally and with valgrind
0test/functional/interface_bitcoin_cli.py -l debug
1valgrind test/functional/interface_bitcoin_cli.py -l debug
Thanks to Marco Falke for all the help. Closes #18684.