In 5554f9cb4abf7e1852dd79d2d75e714fa8cbeadd “test: add interface_ipc_mining.py test calling bitcoin-mine”:
On macOS the limit is 104, which I run into when using a RAM disk with --tmpdir=/Volumes/RAMDisk/tmp
.
Additionally, our temp path has funny characters, e.g. /tmp/test_runner_₿_🏃_20250321_104521
so we need the length in bytes.
0diff --git a/test/functional/interface_ipc_mining.py b/test/functional/interface_ipc_mining.py
1index c9eedfba5d..73b9a3fb6b 100755
2--- a/test/functional/interface_ipc_mining.py
3+++ b/test/functional/interface_ipc_mining.py
4@@ -24,8 +24,11 @@ class TestBitcoinMine(BitcoinTestFramework):
5 # Always run multiprocess binaries
6 self.binary_paths.bitcoind = self.binary_paths.bitcoin_node
7
8- # Work around default CI path exceeding maximum socket path length
9- if len(self.options.tmpdir + "/node0/regtest/node.sock") < 108:
10+ # Work around default CI path exceeding maximum socket path length.
11+ # On Linux sun_path is 108 bytes, on macOS it's only 104. Includes
12+ # null terminator.
13+ socket_path = self.options.tmpdir + "/node0/regtest/node.sock"
14+ if len(socket_path.encode('utf-8')) < 104:
15 self.extra_args = [["-ipcbind=unix"]]
16 self.mine_args = []
17 else: