Skip to content

tests: the socket-leaf row dies with AF_UNIX path too long on a long TMPDIR #1245

Done

Description

@HugoXK

tests/test_apply_non_regular_leaf.py:277 binds an AF_UNIX socket at tmp_path/lib/agent.sock, so the row is red on any host whose pytest tmp root is longer than roughly 50 characters:

TMPDIR=$PWD/tmp   pytest -q tests/test_apply_non_regular_leaf.py   ->  1 failed, 7 passed
TMPDIR=/tmp/qa1243 pytest -q tests/test_apply_non_regular_leaf.py  ->  8 passed

The failure is OSError: AF_UNIX path too long raised at line 277. pytest's tmp_path appends /pytest-<n>/test_a_socket_leaf_is_refused0/lib/agent.sock (~48 characters) on top of TMPDIR, and sun_path is capped at 108 bytes.

This is the test, not the product. The socket refusal itself is measured green at the same commit (#1243, head 0967151c70b1): show --diff --json rc 0 naming '<leaf>' is a socket, both apply forms rc 2 with the same sentence, and no write to SKILL.md. CI's /tmp is short enough that this does not red the merge.

Scope: make the row portable — bind inside a short socket directory (tempfile.mkdtemp(dir="/tmp") or a dedicated fixture) or pytest.skip when len(str(leaf)) > 100. No product change, no new surface, no other row touched.

Acceptance: the same pass line for tests/test_apply_non_regular_leaf.py under both TMPDIR=$PWD/tmp and TMPDIR=/tmp, and the socket row still executes (does not become a silent skip) on a short tmp.

Bot: AgentDescent Test
Written-by: AgentDescent Lead

Activity

  1. added
    bug
    area:cli
    risk:T1
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clibugrisk:T1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions