F1 menu tests: the variables they change come back, also on a failed assertion #2500
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2500
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2500"
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?
@breachato on GitHub · 2026-11-29 13:42 UTC · original
breachato:menu-tests-env-lock→main· +988 −871 · 32 files · 14 commits · closed without merging[pr-tests]
What it changes
Updated after
mainmoved:mainnow hastest_env_lock()and takes it in the shadow-lift test, which fixes the race this PR first addressed (5 of 5 parallel runs failed on829188e; on today'smainthey pass). What is left is the point raised in review:a_change_is_saved_at_once_however_the_game_was_startedremovesVICTORY_MENU_FILEand pointsVICTORY_HOMEat a folder it deletes at the end, and puts neither back. A later test in the same process then saves into that deleted folder.vehicle_auto_center_zero_is_normalized_to_offsetsVICTORY_VEHICLE_AUTO_CENTERwithout the lock and restores it by hand after its assertions, so a failed assertion leaves it set.This moves the shadow-lift test's
Restoreguard to the test module (Restore::saving(&[...])) and takes it right aftertest_env_lock()in those three tests. The vehicle test now takes the lock too. Values, or their absence, come back before the lock is released, even when an assertion unwinds. Test-only; no runtime code changes.How it was tested
cargo test -p victory-gpu --lib --locked host::menu::tests, Windows 11, toolchain 1.98.1: 28 passed, 3 of 3 parallel runs, and with--test-threads=1.cargo testpassed for the crates it touches: yes (the menu tests; nothing else changes)How to try it
cargo test -p victory-gpu --lib --locked host::menu::tests, in parallel and with-- --test-threads=1: 28 pass both ways. The change is in the tests module only.Checked for overlap
menu.rstoo (help text only, no shared lines).Assisted by Claude.
@ANDREANIADS on GitHub · 2026-11-29 13:58 UTC · original
At
43658eathe three tests take the same mutex. One isolation detail survives even with a single test thread:a_change_is_saved_at_once_however_the_game_was_startedremovesVICTORY_MENU_FILEand replacesVICTORY_HOME, then deletes the temporary directory without restoring either variable. In a synthetic process seeded with both values, repeating just those two environment operations under a lock and reacquiring it yielded(unset, temporary-home). This checks state lifetime only; I did not run the Windows suite.Could the test reuse the gray-shadow test’s
Restoreguard for both keys? Declare it after acquiring_envso the original values (including absence) are restored before unlocking, even if an assertion unwinds.@breachato on GitHub · 2026-11-29 17:32 UTC · original
Good catch, thanks. Done in
fbe67fd:Restorenow lives in the test module, and all three tests take it right afterenv_lock()(VICTORY_MENU_FILE+VICTORY_HOMEina_change_…,VICTORY_VEHICLE_AUTO_CENTERin the vehicle test). The values, or their absence, come back before the lock is released, also on unwind. The menu tests pass in parallel (3/3) and with--test-threads=1.F1 menu tests: the ones that change the environment run one at a timeto F1 menu tests: the variables they change come back, also on a failed assertionfbe67fdf5bto84871ab68884871ab688to2838098035@breachato on GitHub · 2026-12-01 13:59 UTC · original
Closing: the menu tests this fixed were removed from
menu.rsin3bde4923(#4635), so there is nothing left to restore.Pull request closed