run_game_wine.sh: a run is torn down once (WINE-TEARDOWN-ONCE) #3246
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!3246
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/wine-teardown-once"
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?
Pull request successfully merged and closed
Claim: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7360399128 (WINE-TEARDOWN-ONCE), following Neutron-0's finding on
scripts/run_game_wine.sh:327with:292.Why
The outer half sets
trap teardown EXIT(:292) and also callsteardownitself before the summary (:327), soteardownran twice. The second run kills a wineserver that is already gone and removes$XDG_RUNTIME_DIR, which is also already gone. That is two more spawns at the end of every run, and on a Windows host they are the costliest ones (Neutron-0 measured 2-3 s).What changed
scripts/run_game_wine.sh:teardown; SESSION_PID=; trap - EXIT. The trap is dropped on the same line, after the explicit teardown. A signal before that point still tears the run down through the trap, as before. Nothing after it starts a process or makes a folder.tests/test_run_game_wine.py:test_a_run_is_torn_down_oncegiveswineservera stub that logs its arguments and checks there are exactly two-kcalls. One is the inner run's, after the title returns (:110), and one is the teardown's.Verification (WSL Ubuntu, Python 3.14; this class skips on Windows; no game files, Wine or GPU needed)
-kcalls; with it, 2.tests/test_run_game_wine.py17 OK;tests/test_run_game_wine_safety.py3 OK;bash -npasses.python -I scripts/check_no_game_data.pyon both files: exit 0. Both stay LF, and the script keeps mode 100755.This touches
tests/test_run_game_wine.pyin a different place from #3241, so the two merge in either order.AI assistance
AI-assisted: written with Claude Code (Claude Opus 5.5). It was reviewed by a separate read-only reviewer agent (Claude Opus 5.5), which checked every path after the trap is dropped (signals,
exit 3, the summary), that noset -ecan skip the explicit teardown, and that the test is free of races. It found nothing blocking; I applied its wording suggestion for the comment.🤖 Generated with Claude Code
Rewrote the branch's commits without a co-author trailer, so the head SHA changed (now
c84899f09). The tree is identical to the reviewed one.VERIFY-3246 — no verificable en esta máquina: sus diecisiete pruebas se saltan en Windows
c84899f09—scripts/run_game_wine.sh(+1/−1),tests/test_run_game_wine.py(+10)python -I tests/test_run_game_wine.pyThe suite is POSIX only and skips whole on Windows, so the fix is not verified here — and a Windows CI reading "17 passed" would be reading nothing.
What the change is, and it is small and pointed:
The run is torn down once: after the summary the
EXITtrap is dropped, so a clean exit does not tear the session down a second time. The failure mode it removes is the one that looks like a stray process after a successful run — and the new test in the same file is what pins it, on a host that can run it.What would verify either of them: a POSIX host with
bash; the test needs no game, no Wine and no KWin (that is the point of its stubs). I do not have one in this session.Written with an AI assistant.
@fiestorra right: this suite is POSIX-only and skips on Windows. I ran it on WSL Ubuntu (Python 3.14): 17 OK with the change, and the new check fails without it. merzleckeier also re-ran it in a Linux sandbox. The CI
linux-python-and-viewerjob runs it too, and it is green here.