From 0f6fc48e88344a8d0f7f5be68503482ba92105cf Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Wed, 9 Aug 2023 13:07:17 +0200 Subject: [PATCH] qa: only run the RPC retry functional test with bitcoind 25.0 --- .cirrus.yml | 1 + tests/test_framework/utils.py | 1 + tests/test_misc.py | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index a0424d01..64156c53 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -51,6 +51,7 @@ task: echo "49df6e444515d457ea0b885d66f521f2a26ca92ccf73d5296082e633544253bf bitcoin-24.0.1-x86_64-linux-gnu.tar.gz" | sha256sum -c tar -xzf bitcoin-24.0.1-x86_64-linux-gnu.tar.gz export BITCOIND_PATH=bitcoin-24.0.1/bin/bitcoind + export IS_BITCOIND_25=0 else # Download the bitcoind binary curl -O https://bitcoincore.org/bin/bitcoin-core-25.0/bitcoin-25.0-x86_64-linux-gnu.tar.gz diff --git a/tests/test_framework/utils.py b/tests/test_framework/utils.py index 15303250..c599e211 100644 --- a/tests/test_framework/utils.py +++ b/tests/test_framework/utils.py @@ -23,6 +23,7 @@ LIANAD_PATH = os.getenv("LIANAD_PATH", DEFAULT_MS_PATH) DEFAULT_BITCOIND_PATH = "bitcoind" BITCOIND_PATH = os.getenv("BITCOIND_PATH", DEFAULT_BITCOIND_PATH) OLD_LIANAD_PATH = os.getenv("OLD_LIANAD_PATH", None) +IS_BITCOIND_25 = bool(int(os.getenv("IS_BITCOIND_25", True))) COIN = 10 ** 8 diff --git a/tests/test_misc.py b/tests/test_misc.py index f1760a39..6156a865 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -12,6 +12,7 @@ from test_framework.utils import ( LIANAD_PATH, COIN, TIMEOUT, + IS_BITCOIND_25, ) from threading import Thread @@ -265,6 +266,7 @@ def test_migration(lianad_multisig, bitcoind): assert len(spend_txs) == 2 and all(s["updated_at"] is not None for s in spend_txs) +@pytest.mark.skipif(not IS_BITCOIND_25, reason="Need 'generateblock' with 'submit=False'") def test_bitcoind_submit_block(bitcoind): block_count = bitcoind.rpc.getblockcount() block = bitcoind.rpc.generateblock(bitcoind.rpc.getnewaddress(), [], False) @@ -283,6 +285,8 @@ def bitcoind_wait_new_block(bitcoind): time.sleep(0.1) continue + +@pytest.mark.skipif(not IS_BITCOIND_25, reason="Need 'generateblock' with 'submit=False'") def test_retry_on_workqueue_exceeded(lianad, bitcoind, executor): """Make sure we retry requests to bitcoind if it is temporarily overloaded.""" # Start by reducing the work queue to a single slot. Note we need to stop lianad @@ -317,7 +321,7 @@ def test_retry_on_workqueue_exceeded(lianad, bitcoind, executor): "Transient error when sending request to bitcoind.*(status: 503, body: Work queue depth exceeded)", "Retrying RPC request to bitcoind", ], - timeout=5 + timeout=5, ) except TimeoutError: continue