Skip to content

test: handle incomplete descriptor directory views - #877

Open
00200200 wants to merge 1 commit into
tox-dev:mainfrom
00200200:codex/filelock-partial-fd-view
Open

00200200 wants to merge 1 commit into
tox-dev:mainfrom
00200200:codex/filelock-partial-fd-view

Conversation

@00200200

Copy link
Copy Markdown

Addresses the descriptor-counting and inode-reuse portion of #864. This does not attempt to fix the other FreeBSD failures discussed there.

Before relying on /dev/fd or /proc/self/fd, check that the listing includes a newly opened descriptor. If neither view does, scan the SC_OPEN_MAX range. Share this helper between both descriptor counters and the inode-reuse fixture, so a standard-stream-only listing cannot hide a live descriptor or simulate reuse while an inode is still held open.

The regressions exercise complete, partial, missing and proc-only directory views using real open/duplicated descriptors and an unlinked file. Nine of the original twelve cases fail before the fix. Library implementation code is unchanged.

Validation on macOS/Python 3.13.4:

  • Full suite: 2,808 passed, 163 skipped, no test failures.
  • After adding a fixture passthrough control, targeted checks: 16 passed, 1 skipped. The supplemental run uses a long temporary path to exercise the existing macOS Unix-socket skip branch.
  • Combined coverage and diff coverage: 100% (73 changed executable lines).
  • Ruff check/format, Ty with the project's type dependencies, and whitespace checks pass.

Native FreeBSD has not been tested.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant