Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tests/test_mcp_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ def built_wrapper() -> Path:

@pytest.fixture(scope="module")
def daemon_sock() -> "Path":
sock_dir = tmp_path / "sock"
sock_dir.mkdir(parents=True, exist_ok=True)
# AF_UNIX sun_path is capped near 104 chars; pytest's tmp_path on macOS CI
# runners (/private/var/folders/.../pytest-of-runner/...) exceeds it, so the
# daemon can't bind. Bind under a short mkdtemp dir. This also fixes a
# NameError: tmp_path was never a parameter of this module-scoped fixture
# (and the function-scoped tmp_path isn't usable from module scope anyway).
sock_dir = Path(tempfile.mkdtemp(prefix="iai-sock-"))
sock_path = sock_dir / "d.sock"
store_dir = sock_dir / "store"
store_dir.mkdir(parents=True, exist_ok=True)
Expand Down
6 changes: 4 additions & 2 deletions tests/test_socket_disconnect_reconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ def _drop_fake_daemon_conn(proc: subprocess.Popen) -> None:

@pytest.fixture
def fake_daemon():
sock_dir = tmp_path / "sock"
sock_dir.mkdir(parents=True, exist_ok=True)
# Short mkdtemp dir: AF_UNIX sun_path is capped near 104 chars and pytest's
# macOS CI tmp_path exceeds it, so the daemon can't bind. This also fixes a
# NameError — tmp_path was never a parameter of this fixture.
sock_dir = Path(tempfile.mkdtemp(prefix="iai-sock-"))
sock_path = sock_dir / "d.sock"

proc = _spawn_fake_daemon(sock_path)
Expand Down
Loading