diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-04-20 06:13:17 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-04-20 06:13:59 -0400 |
commit | dc5da7fe7b0c51dac269d6c630d9b54581b07900 (patch) | |
tree | dcab81d169e6ceb33f4f4006ff8fe05856b80a0d /src/net.h | |
parent | f8102d90889a786a568d62ee4eef13049f8cea00 (diff) | |
parent | 92fe537cf704dfb4ae830c8c8b382f08c4893e65 (diff) |
Merge #18691: test: add wait_for_cookie_credentials() to framework for rpcwait tests
92fe537cf704dfb4ae830c8c8b382f08c4893e65 test: fix intermittent race condition in interface_bitcoin_cli.py (Jon Atack)
c648e636b2f230db5f1d1137088685f74ae42454 test: add wait_for_cookie_credentials() to test framework (Jon Atack)
Pull request description:
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
```diff
diff --git a/src/httprpc.cpp b/src/httprpc.cpp
index 60c4d06f12..3dd06c4758 100644
--- a/src/httprpc.cpp
+++ b/src/httprpc.cpp
@@ -291,6 +291,7 @@ static bool InitRPCAuthentication()
bool StartHTTPRPC()
{
LogPrint(BCLog::RPC, "Starting HTTP RPC server\n");
+ UninterruptibleSleep(std::chrono::seconds{11});
if (!InitRPCAuthentication())
```
then run the test normally and with valgrind
```
test/functional/interface_bitcoin_cli.py -l debug
valgrind test/functional/interface_bitcoin_cli.py -l debug
```
Thanks to Marco Falke for all the help. Closes #18684.
Top commit has no ACKs.
Tree-SHA512: 1b76635b5b1d6b05138affef7ab788aa3bc3fc75b0c69ba778ecdf81063cfe02a8dd7667cfd63a6c6e19b2dac47d7a8b755e334d8af5c0ab9d4026808ee96c83
Diffstat (limited to 'src/net.h')
0 files changed, 0 insertions, 0 deletions