test(build-context): guard the second FIFO case on mkfifo availability - #502
Open
kevin9327 wants to merge 1 commit into
Open
test(build-context): guard the second FIFO case on mkfifo availability#502kevin9327 wants to merge 1 commit into
kevin9327 wants to merge 1 commit into
Conversation
test_build_context_records_non_regular_files_in_the_ledger checks hasattr(os, "mkfifo") before creating a named pipe. Its neighbour test_build_context_records_non_regular_entries_in_the_ledger calls os.mkfifo directly, so on a platform without named pipes it raises AttributeError during setup instead of reporting that it cannot run. Apply the guard the sibling case already uses. Signed-off-by: kevin9327 <kevin9327@users.noreply.github.com>
This was referenced Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
tests/nodes/test_build_context.pyhas two adjacent cases that build a named pipe to prove theledger keeps non-regular entries. One guards the primitive, the other does not:
os.mkfifodoes not exist on Windows, so the second case raisesAttributeErrorduring setup.Its assertion — that a discovered FIFO is retained as failed ledger evidence rather than
silently dropped — is never evaluated, and the result is indistinguishable from a real
regression in that ledger behaviour.
Fix
Apply the guard the sibling case already uses, with the same wording. Two lines; no change on
any platform that has
os.mkfifo, so CI (ubuntu-latest) continues to execute the caseexactly as before.
Reproduction
Windows 11, Python 3.12.10, against unmodified
main(704bc95). Both cases selected togetherso the asymmetry is visible in one run:
With this change, same command:
What must still hold
tests/nodes/test_build_context.pyas a whole — exactly one case changes state, and the passingset is untouched:
The eleven that remain are unrelated to named pipes and are not touched here.
ruff check tests/—All checks passed!ruff format --check tests/—126 files already formattedDiff is
1 file changed, 2 insertions(+).