tests: resolve the temporary directory before matching run_preset paths #3514
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3514
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3512"
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?
@KelboLive on GitHub · 2026-11-29 19:50 UTC · original
KelboLive:tests/run-preset-temp-path→main· +4 −0 · 1 files · 1 commits · closed without mergingChange
tests/startup_run_preset_check.pycompared--printoutput against a package path built from theinherited
TEMP.run_preset.pyprints resolved paths, so on a host whoseTEMPis the 8.3 shortform the check failed although the run itself was correct:
Resolve the temporary directory once, before the package path is derived from it, so both sides name
the same path.
Verification
Base:
upstream/main5b86df1d6. Python 3.12, Windows 10.0.26100.With
TEMP=C:\Users\ADMINI~1\AppData\Local\Temp(the 8.3 short form):With
TEMP=C:\Users\Administrator\AppData\Local\Temp(the long form), the check passes both before andafter, which is why this only shows up on a host that exports the short form.
The before/after pair is the negative control: the same command on the parent commit still prints
FAIL: --print output, and the only difference is the resolution added here.Evidence and follow-up
CI runners export a long
TEMP, so CI cannot reproduce the failure; the two runs above are theevidence instead. No production code changes.
run_preset.pyalready resolves, so nothing changes onits side.
@Leyukaka on GitHub · 2026-11-29 20:05 UTC · original
This overlaps with #3510 (opened earlier, item (b) of #3509), which fixes the same
--print outputfailure intests/startup_run_preset_check.py.The difference, by reading the two diffs: here the temp dir is resolved up front, so the expected and printed paths would still match if
tools/startup/run_preset.py:264stopped callingresolve(). #3510 passes the package aspackage/bin/..and compares the whole mount line againstpackage.resolve(), so it fails on that regression on any host, short TEMP or not. Neither change has run on an 8.3 TEMP in CI.Only one of the two needs to land. Either is fine with us; maintainer's pick.
@Not-Saii on GitHub · 2026-11-29 21:33 UTC · original · reviewed
Review of
cc1dc1a2af1156c6140028ec5354dca46da77300The fix is correct and minimal.
run_preset.py:264resolves--package, and:286prints the resolved path in themount: substline. The only path-string comparison in the check (tests/startup_run_preset_check.py:258) built its expected value from the unresolvedTemporaryDirectorypath. Resolvingtmponce at:203, beforepackageis derived, makes both sides use the same spelling. Rebinding the localtmpdoes not affectTemporaryDirectorycleanup. The PR changes only this one test file. It touches no CMake, CI, scripts or agent config, and adds no downloads or network calls.There are no blocking findings. The two SHOULDs below are about the evidence text and about coordinating with #3510.
SHOULD 1: CI does reproduce this failure
The PR body says CI runners export a long
TEMP, so CI cannot reproduce the failure. They can:RUNNER~1in other tests' paths).startup_run_presetfails with the sameFAIL: --print output. Issue #3509 item (b) records the same failure.startup_run_preset, because it is not in theprtest filter. The full suite reproduces it (a main push, orworkflow_dispatchon a fork).Please correct the evidence section and cite that run.
SHOULD 2: #3510 fixes the same failure and claimed it first
Refs #3507and no link to #3510. CONTRIBUTING.md:14 asks to link overlapping PRs and agree which one lands first.git merge-treeon both heads). They are also compatible in behavior: with both applied, #3510'spackage.resolve()is a no-op on a path that is already resolved.--packagethroughbin/..and matches the whole mount line, so its check fails on any host if the launcher stops resolving. With this PR alone, deleting the fix still passes on a host whose temp path is already canonical, and on the Linux job. The sandbox run below confirms this (leg 4).Please link #3509 and #3510 and agree with that author which PR lands. If this one lands, add a control that does not depend on the host's
TEMP, for example thebin/..argument.NIT
Refs #3507to the PR body.What the test proves
startup_run_presetpassing shows that the--printmount line matches the resolved package path.Sandbox run (Windows Sandbox, networking disabled, vGPU on, PR tree mapped read-only)
cc1dc1a2af1156c6140028ec5354dca46da77300, exported withgit archiveand copied to a scratch folder inside the sandbox.cmake --preset dev -DX2W_WITH_OPUS=OFF -DINTAKE_PYTHON=<venv python>exited 0. The test is pure Python, so no build was needed.ctest --preset dev --no-tests=error -R '^startup_run_preset$' -V, withTEMPandTMPset as listed below.8.3 short names are disabled in the sandbox: the short form of the temp directory equals its long form. The exact 8.3 case was therefore not reproduced. I used a directory junction as
TEMPinstead. It is the same class of input: a temp path thatPath.resolve()rewrites.OK: 12 preset choices, staging and controlsOK: 12 preset choices, staging and controls:203deleted in the scratch copyFAIL: --print output,1 failure(s)_hardwaretests.TEMPis non-canonical, not caught when it is canonical.CI at this head (run 46303155493)
startup_run_preset(prfilter).tests/startup_run_preset_check.py(ok). Linux/tmpis canonical, so that run cannot tell fixed from unfixed.@KelboLive on GitHub · 2026-11-29 22:34 UTC · original
Closing as a duplicate of #3510, which was opened earlier and fixes the same failure.
Its comparison is also the better one: it builds the expected mount line from \package.resolve()\ and passes the package as \package/bin/.., so it fails if
un_preset.py\ stops resolving. This version resolves the temporary directory up front, which would still match in that case.
Thanks for catching it — I checked for open PRs by issue number rather than by the file being changed, and missed #3510.
Pull request closed