diff --git a/src/qt/test/rpcnestedtests.cpp b/src/qt/test/rpcnestedtests.cpp --- a/src/qt/test/rpcnestedtests.cpp +++ b/src/qt/test/rpcnestedtests.cpp @@ -47,8 +47,6 @@ TestingSetup test; - SetRPCWarmupFinished(); - std::string result; std::string result2; std::string filtered; diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -83,6 +83,17 @@ // instead of unit tests, but for now we need these here. RPCServer rpcServer; RegisterAllRPCCommands(config, rpcServer, tableRPC); + + /** + * RPC does not come out of the warmup state on its own. Normally, this is + * handled in bitcoind's init path, but unit tests do not trigger this + * codepath, so we call it explicitly as part of setup. + */ + std::string rpcWarmupStatus; + if (RPCIsInWarmup(&rpcWarmupStatus)) { + SetRPCWarmupFinished(); + } + ClearDatadirCache(); pathTemp = fs::temp_directory_path() / strprintf("test_bitcoin_%lu_%i", (unsigned long)GetTime(),