test(build): the make_game checks let go of the work folder's lock, so Windows can delete their temporary folders #804
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!804
Loading…
Reference in a new issue
No description provided.
Delete branch "d4nkn3ss/Longshot:fix/test-work-lock-windows"
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?
Type: test · Risk: low · Tested on: Windows 11, RTX 3080 · Needs: none
Why
On Windows, five of the builder's game-free checks have errored on main since #630 (one build at a time in a work folder): 41 errors in all, each
PermissionError: [WinError 32] ... work\make_game.lock. They runmake_game.main()in their own process with the work folder in a temporary directory.main()now keepsmake_game.lockopen for the rest of the process, and Windows can't delete a folder holding an open file, so every test's clean-up fails. The noise hides real failures in those checks on Windows. I searched the tracker (forge.py issue list --state all) and found no issue for it.What changed
make_game.pygetsrelease_work(), which lets go of the work folder's lock if this process holds one. The five checks call it before their temporary folders are removed. A build doesn't change: its lock still goes when its process ends.release_work(), also used bylock_work()where it let go of a lock on another folder (the same two lines, now in one place).test_cpp_preflight.py,test_make_game_prepare.py(both test classes),test_missing_nup.py,test_make_game_cache.pyandtest_linux_preflight.pyregisterrelease_workas a clean-up after the temporary folder's, so it runs first. They usegetattr(..., "release_work", lambda: None)because theirLONGSHOT_*_TEST_SOURCEoverrides can point at amake_game.pyfrom before #630, which has no lock.Measurements
Verdict: passes: the 41
WinError 32errors are gone.test_cpp_preflight,test_make_game_prepareandtest_missing_nupnow pass on Windows.test_make_game_cacheandtest_linux_preflightkeep only the shipped-profile failures that #592 fixes, and with that PR's diff on top of this one both pass.Hardware: Windows 11 Pro 26300, RTX 3080 10 GB, i9-12900K, 64 GB; Python 3.12, llvm-mingw from the Longshot Builder
Scene: none (game-free checks)
Method:
python -I -B tests/run_all.pyfrom PowerShell, once on each commit; the failing checks and their unittest summaries comparedHow to reproduce: on Windows,
python -I -B tests/run_all.pyon main and on this branchaa95d35fdcc30ba2test_cpp_preflight.pytest_make_game_prepare.pytest_missing_nup.pytest_make_game_cache.pytest_linux_preflight.pytest_work_lock.pyrun_all.pyin allFlags and settings
None
Testing
Tested:
python -I -B tests/run_all.pyfrom PowerShell on Windows 11, on main @aa95d35fand on this PR @dcc30ba2(numbers above). The 14 checks that fail here fail on main too:test_appimage_player_build(#624),test_cpm_discovery(#561),test_crash_dialog(#626),test_env_onandtest_readback_late(#622),test_lift_cleanup_error(#623),test_linux_preflightandtest_make_game_cache(#592),test_oot_state_tap,test_options_budget_once,test_release(no openssl on PATH, #144),test_tested_configurations,test_vk_pgo,test_walk_key(#537).test_work_lock.pypasses, solock_work()behaves as before withrelease_work()inside it.test_make_game_cache.pyandtest_linux_preflight.pywere run again with #592's diff applied on top: both pass.Not tested:
main()and the CLI are unchanged; the lock is still taken where it was and goes with the process.Must be tested: None. The game-free checks cover the change.
Risks
What could break: nothing for a player: no build calls
release_work(). A check that wanted the lock held after its test finished would lose it, and none does.Turning it off: revert the commit.
Compatibility: Nothing changes: saves, options, the caches, the vk ABI and the builder's behaviour are untouched.
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
WIP: test(build): the make_game checks let go of the work folder's lock, so Windows can delete their temporary foldersto test(build): the make_game checks let go of the work folder's lock, so Windows can delete their temporary foldersView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.