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.
diff --git a/test/functional/interface_ipc_mining.py b/test/functional/interface_ipc_mining.py
index c9eedfba5d..73b9a3fb6b 100755
--- a/test/functional/interface_ipc_mining.py
+++ b/test/functional/interface_ipc_mining.py
@@ -24,8 +24,11 @@ class TestBitcoinMine(BitcoinTestFramework):
# Always run multiprocess binaries
self.binary_paths.bitcoind = self.binary_paths.bitcoin_node
- # Work around default CI path exceeding maximum socket path length
- if len(self.options.tmpdir + "/node0/regtest/node.sock") < 108:
+ # Work around default CI path exceeding maximum socket path length.
+ # On Linux sun_path is 108 bytes, on macOS it's only 104. Includes
+ # null terminator.
+ socket_path = self.options.tmpdir + "/node0/regtest/node.sock"
+ if len(socket_path.encode('utf-8')) < 104:
self.extra_args = [["-ipcbind=unix"]]
self.mine_args = []
else: