Page MenuHomePhabricator

test: add wait_for_cookie_credentials() to framework for rpcwait tests
ClosedPublic

Authored by PiRK on Jan 18 2021, 16:39.

Details

Summary

test: add wait_for_cookie_credentials() to test framework

to be able to ensure the cookie file is written and auth credentials available
when testing CLI/RPC commands before the RPC connection is up.

test: fix intermittent race condition in interface_bitcoin_cli.py

by calling wait_for_cookie_credentials() to ensure the cookie file is written
and auth credentials available for testing the CLI -rpcwait option before the
RPC connection is up.

This is a backport of Core PR18691

Test Plan
diff --git a/src/httprpc.cpp b/src/httprpc.cpp
index 9e09af5a2..8301f8cd1 100644
--- a/src/httprpc.cpp
+++ b/src/httprpc.cpp
@@ -453,6 +453,7 @@ static bool InitRPCAuthentication() {

 bool StartHTTPRPC(HTTPRPCRequestProcessor &httpRPCRequestProcessor) {
     LogPrint(BCLog::RPC, "Starting HTTP RPC server\n");
+    UninterruptibleSleep(std::chrono::seconds{11});
     if (!InitRPCAuthentication()) {
         return false;
     }

ninja && test/functional/test_runner.py interface_bitcoin_cli

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Jan 18 2021, 16:39
deadalnix requested changes to this revision.Jan 18 2021, 17:03
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
test/functional/test_framework/test_node.py
364 ↗(On Diff #27051)

Relayout

This revision now requires changes to proceed.Jan 18 2021, 17:03
Fabien added a subscriber: Fabien.
Fabien added inline comments.
test/functional/test_framework/test_node.py
347 ↗(On Diff #27051)

Move comment

363 ↗(On Diff #27051)

Dito

This revision is now accepted and ready to land.Jan 23 2021, 20:50

rebase onto master to fix conflict with D8975 (BLOCKS + 1)