run_game_wine.sh: a run is torn down once (WINE-TEARDOWN-ONCE) #3246
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!3246
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3246"
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?
@LouisRiverstone on GitHub · 2026-12-02 22:16 UTC · original
LouisRiverstone:fix/wine-teardown-once→main· +12 −1 · 2 files · 1 commits · merged 2026-12-03 15:45 UTCClaim: #2570 (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
@merzleckeier on GitHub · 2026-12-02 22:21 UTC · original · reviewed
Reviewed
d19028d1onf3865cae8using a Linux sandbox with the existing stubs. The new test sees threewineserver -kcalls against the original script and two with this change. All 17 tests passed on this head, and all 18 passed with #3241 at8bc989c12applied on top.I also stubbed a session that exits before the inner launcher starts. The outer launcher returned its normal early-exit status 3, called
wineserver -konce and removed its temporary XDG directory. No real Wine or game files were used.d19028d127toc84899f090@LouisRiverstone on GitHub · 2026-12-02 22:24 UTC · original
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.@fiestorra on GitHub · 2026-12-02 22:48 UTC · original
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.
@LouisRiverstone on GitHub · 2026-12-03 02:11 UTC · original
@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.