From 4cd72453c5fe791db41909b4695f59c5a2fe3d03 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Sat, 24 Oct 2026 07:29:08 +0000 Subject: [PATCH 1/2] test: disable the unused Bitcoin Core P2P listener Device tests access the node through RPC and do not need a P2P listener. Avoid selecting and releasing a port that another process can occupy before bitcoind binds it. --- test/test_device.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/test_device.py b/test/test_device.py index 4c09c548a..22f1f1fa6 100644 --- a/test/test_device.py +++ b/test/test_device.py @@ -76,7 +76,6 @@ def get_free_port(): s.close() return port - self.p2p_port = get_free_port() self.rpc_port = get_free_port() self.bitcoind_proc = subprocess.Popen( @@ -87,7 +86,7 @@ def get_free_port(): "-noprinttoconsole", "-fallbackfee=0.0002", "-keypool=1", - f"-port={self.p2p_port}", + "-listen=0", f"-rpcport={self.rpc_port}" ] ) From a9fa5460737edc9584cd884330ab42230f15783f Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Sat, 24 Oct 2026 07:30:29 +0000 Subject: [PATCH 2/2] test: allow more time for initial block generation Allow the initial supply-wallet mining RPC 120 seconds rather than the ordinary 30-second timeout, which CI has exceeded before device tests start. Keep the default timeout for other node and wallet RPC calls. --- test/test_device.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/test_device.py b/test/test_device.py index 22f1f1fa6..ce9adb1d7 100644 --- a/test/test_device.py +++ b/test/test_device.py @@ -13,7 +13,7 @@ from typing import Dict -from authproxy import AuthServiceProxy, JSONRPCException +from authproxy import AuthServiceProxy, JSONRPCException, HTTP_TIMEOUT from hwilib import _bech32 as bech32 from hwilib._base58 import xpub_to_pub_hex, to_address, decode from hwilib._cli import process_commands @@ -120,11 +120,12 @@ def get_free_port(): # Make sure there are blocks and coins available self.rpc.createwallet(wallet_name="supply") self.wrpc = self.get_wallet_rpc("supply") - self.wrpc.generatetoaddress(101, self.wrpc.getnewaddress()) + mining_rpc = self.get_wallet_rpc("supply", timeout=120) + mining_rpc.generatetoaddress(101, self.wrpc.getnewaddress()) - def get_wallet_rpc(self, wallet): + def get_wallet_rpc(self, wallet, timeout=HTTP_TIMEOUT): url = self.rpc_url + f"/wallet/{wallet}" - return AuthServiceProxy(url) + return AuthServiceProxy(url, timeout=timeout) def cleanup(self): if self.bitcoind_proc is not None and self.bitcoind_proc.poll() is None: