tests: the two write-failure cases in test_feature_scan need preexec_fn, which Windows does not have #2667
No reviewers
Labels
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!2667
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2667"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@fiestorra on GitHub · 2026-11-30 00:56 UTC · original
fiestorra:fix/feature-scan-posix-only→main· +8 −1 · 1 files · 3 commits · merged 2026-12-01 11:29 UTCTwo tests in
tests/test_feature_scan.pyfail on Windows and CI cannot see it, because that file runs on Linux there.Found while verifying #2665 - which is not the cause (the same two fail on
mainwithout it, and its only change to the file is a docstring line).The cause
FeatureScanAtomicOutputTests.run_scanpassesand
preexec_fnis POSIX-only. The two cases that use it (test_failed_write_keeps_existing_report,test_failed_write_leaves_no_temporary_file) therefore cannot run here at all - they die insubprocess.Popenbefore the tool is started.The change
Two decorators, one per case:
The skip prints its reason, so the suite no longer reports a red that a Windows contributor cannot distinguish from their own breakage. On POSIX nothing changes: the decorator is a no-op there, and the cases run exactly as before.
What this does not do
It does not test the same behaviour on Windows. The intent of those cases - a failed write must leave the previous report intact and no temporary file behind - is real and worth covering;
preexec_fnis simply the POSIX way to inject the failure. A portable variant would make the destination unwritable instead (a directory where the file should go is enough), which would exercise the same intent on every platform. I did not write it because it tests a different failure point - after the tool opens its temp file rather than before - and that is a judgement for whoever owns this tool.A third commit the description above did not mention (
463f7593d)runtime.yml's selectors send eachtests/test_*.pythroughpython -I <file>unless it importspytestor definesHAVE_NUMPY =, and this file does neither. Its__main__scansglobals()for names starting withtest_, soFeatureScanAtomicOutputTestsnever ran in CI at all - which meant the two skips above had no effect there either.The script path now loads the class explicitly:
merzleckeier spotted the gap by reading the call site rather than the diff; the fix is mine, and it is the reason this change now protects something in the job that matters.
The extra commit at the tip (no longer carried)
The branch used to carry
a3b5ebea1(test(semantic): align computed-I/J f16 interp oracle…), added only becausesemantic-testswas red onmainfor that oracle and every branch cut frommaininherited it.mainnow has the same edit asc717967d0, so a rebase drops the commit and this pull request no longer touchestests/semantic/test_interp_computed_ij_fallback.py- the diff is only what this change actually needs.AI-assisted: yes - DeepSeek v4.1 (flash) as the coding agent, with a separate reviewer agent reading the change before submission. Where and on what: the measurements above were taken on Windows 11 with MSVC 19.44.35226 on an RTX 4090 (NVIDIA driver 621.24) where a C++ or GPU path is involved; Python and docs cases need none of it.
Written with an AI assistant.
@merzleckeier on GitHub · 2026-11-30 01:14 UTC · original
Independent Python 3.12 A/B with #2665. I merged #2665
3209231b3and this PRc6f4b809cintomain0eab02a8b, then restored onlytests/test_feature_scan.pyfrom the #2665-only merge for the control. Windows job · Linux job.pytestcollected 16 tests in both arms. Windows 3.12.10 went from 14 passed and twoValueErrorfailures atPopen(preexec_fn=…)to 14 passed and two explicit skips. Linux 3.12.16 passed all 16 in both arms, including the atomic-write failure checks.python -I <file>, including the Windows standard-library step. Its__main__invokes only the top-leveltest_*functions, so the entireFeatureScanAtomicOutputTestsclass is absent from that invocation. The standalone control printed OK on both operating systems. I also tried loading that class withunittest.defaultTestLoaderfrom__main__on Linux, and all three class methods ran alongside the existing standalone checks.Synthetic fixtures only. AI-assisted with OpenAI Codex.
@fiestorra on GitHub · 2026-11-30 03:07 UTC · original
Rebased onto current
mainwith the one commitmainis missing, like my other pull requests:semantic-testswas the only failing check here and it fails onmain, for the interp oracle - so a branch cut frommaininherits it and cannot show a result of its own. Nothing about this change touches the translator.Verified after the rebase, on this branch:
If #2633 merges first this second commit becomes a duplicate and can be dropped; if this lands first, #2633 becomes a no-op.
Written with an AI assistant.
@fiestorra on GitHub · 2026-11-30 03:16 UTC · original
Your "READ IN CODE" point turned out to be the most useful line in the review, and it needed a third commit:
463f7593d.You noted that the CI selectors send this file through
python -I <file>, and that its__main__only invokes the top-leveltest_*functions, soFeatureScanAtomicOutputTestsis absent from that invocation. That means the two skips this PR adds never took effect in CI - they only mattered for a pytest run, which is what a contributor does locally and what CI does not.So the script run now loads the class explicitly:
Measured here, in both invocation paths:
So the class runs in the script path now, with its two Windows skips doing what the PR says, and the three Linux cases passing as your defaultTestLoader experiment predicted.
What this says about the PR as a whole: it was fixing a failure that CI could not see and doing so in an invocation CI does not use. Thank you for reading the call site rather than just the diff - the change is now worth something where it matters.
Written with an AI assistant.
463f7593d9to0d94741771@fiestorra on GitHub · 2026-11-30 14:00 UTC · original
Re-verified after the rebase onto
main20fe0c754, on this machine (Windows 11, MSVC 19.44.35226): the diff no longer carries the interp-oracle commit (mainhas it asc717967d0), and what is left still passes.What I did not test: the rest of the change, and anything the rebase did not touch. This confirms the rebase kept the change working, not that the change is correct - that is what the review and the CI are for.
Written with an AI assistant.
@aegish-zagi on GitHub · 2026-11-30 14:36 UTC · original
VERIFY-2667 — PASS
0d94741771| merge state vs mainb17b22d33: CLEAN (scratch merge, no conflicts)@KelboLive on GitHub · 2026-11-30 16:19 UTC · original
Independent check on Windows (not the author), at
e5c849280.python -I tests/test_feature_scan.py: 3 tests, OK, 2 skipped. The skips are the intended ones: both cases declarepreexec_fn ... is POSIX-only.0 failed checks, 0 failed tests).So the PR does exactly what it says on Windows: gates the two POSIX-only cases instead of failing them. Coverage of the two write-failure paths is not exercised on this OS (they need fork/preexec), which is worth knowing but is the documented reason.
Environment: Windows 11 Pro 10.0.26200.9711, Python 3.12.10.
AI-assisted: yes (opencode).
@aslan2142 on GitHub · 2026-12-01 11:29 UTC · original · approved these changes
LGTM. Skipping the two POSIX-only
preexec_fnwrite-failure tests on Windows and runningFeatureScanAtomicOutputTestsintests/test_feature_scan.py's__main__block fixes both Windows compatibility and silent skipping underpython -I. Clean-room verified, 5/5 CI green, and independently verified. Merging.(AI-assisted review.)