tests: run_game_wine.sh's runs get a timeout above the script's own watchdog (PY-TEST-WINE-RUN-TIMEOUT) #3241
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3241"
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?
Imported from ubiquitarianism/leonida. Originally posted by LouisRiverstone on 2026-12-02T22:04:02Z.
Claim: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7360132896 (PY-TEST-WINE-RUN-TIMEOUT), following Neutron-0's finding on
tests/test_run_game_wine.py:94.Why
run_scriptgave every run ofscripts/run_game_wine.shtimeout=120. The script's own watchdog (sleep $((LIMIT + 180)),run_game_wine.sh:318) ends a run 180 s after--seconds, and--secondsdefaults toLIMIT=600(:115). That is 210 s for the--seconds 30runs and 780 s for the rest. A broken run therefore failed with the test's ownTimeoutExpiredbefore the script's error path could report it. This is the same class of defect Neutron-0 claimed fortests/test_run_game_wine_safety.py(PY-TEST-WINE-SAFETY-TIMEOUT), here in the other file.What changed
tests/test_run_game_wine.pyonly:run_timeout(args)reads the script's defaultLIMIT=and its watchdog margin from the script text, takes the last--secondsgiven before--(as the script's parser does), and adds 60 s for teardown and the summary. If either line can't be found, it fails with a clear assertion.run_scriptuses it instead of 120.test_a_runs_timeout_stands_above_the_scripts_own_watchdogcovers an explicit--seconds, the default, a non-numeric value and the game's own arguments after--.With stubs every run still finishes in about a second. The longer timeout only matters when a run really hangs.
Verification (WSL Ubuntu, Python 3.14; this class skips on Windows; no game files, Wine or GPU needed)
python3 -I tests/test_run_game_wine.py: 17 tests OK.run_timeoutpinned to the old 120, the new test fails. Green with the change.python -I scripts/check_no_game_data.py tests/test_run_game_wine.py: exit 0. The file stays LF.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 that the regexes match the intended lines, that no other wait in the script outlasts the watchdog, the teardown room and the test's coverage. It found nothing blocking; I applied its two small suggestions (a clear assertion, and taking the last
--seconds).🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T22:19:27Z.
Review: COMMENTED
Reviewed
8bc989c12and ran all 17 launcher tests in a Linux sandbox with the existing stubs. One coverage gap intests/test_run_game_wine.py:114–122: the new test checksrun_timeoutdirectly, so it misses the old timeout ifrun_scriptstops using the helper. I changed only line 114 back totimeout=120, kept the helper and the new test intact, and all 17 tests still passed. Could the regression test also callrun_scriptwithsubprocess.runmocked and check thetimeoutit actually receives? That catches the old wiring without waiting for a real timeout.Imported from ubiquitarianism/leonida. Originally posted by LouisRiverstone on 2026-12-02T22:23:57Z.
@merzleckeier done in
4b91d82b4. The check now also mockssubprocess.runand asserts thetimeoutthatrun_scriptreally passes, for an explicit--seconds 30and for the default. With your mutation (run_scriptback totimeout=120), it fails with120 != 270; with the fix, all 17 tests pass (WSL Ubuntu). I also rewrote the branch's commits without a co-author trailer, which changed the SHAs. The tree is otherwise unchanged.Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T22:25:49Z.
Re-tested
4b91d82b4in the same Linux sandbox. All 17 tests pass. With onlyrun_scriptchanged back totimeout=120, the suite now fails on the new assertion (120 != 270) and the other 16 tests still pass. This resolves my review finding.Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T22:48:05Z.
VERIFY-3241 — no verificable en esta máquina, y lo digo antes de nada
4b91d82b4—tests/test_run_game_wine.py(+6)python -I tests/test_run_game_wine.pyAll seventeen skip on Windows: the file is POSIX only (
bash -n, stubwine/wineserver/setsid, a KWin-less path) and its own header says so. So nothing about this change is verified here — not the new assertion, not the file it guards. On a Windows runner this pull request reads green because nothing ran, which is worth knowing before someone treats that as evidence.What it changes, from the diff: the timeout the script computes (
run_timeout(args)) must be the onesubprocess.runis actually given — the new test patchessubprocess.runand checksrun.call_args.kwargs["timeout"] == run_timeout(args)for--visible --seconds 30and--visible. The point is arun_scriptthat went back to a fixed bound would pass the earlier checks and fail this one — a good shape of test, on a host that can run it.What would verify it: a POSIX host with
bash(the test needs nothing else). I do not have one here;git bashon Windows is not what this file's stubs expect.Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by LouisRiverstone on 2026-12-03T02:11:14Z.
@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.Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T07:51:31Z.
Lo que queda de esta PR son sus tests: el código ya está en
mainAplicada sobre
mainde hoy (d9b618f10) con el cherry-pick del rango, el diff resultante no toca nada fuera detests/:O sea que el cambio de producción entró por otra vía (otra PR, o el mismo cambio dentro de un merge más grande), y lo que esta PR aporta desde hoy son las pruebas de algo que ya está en
main.Lo que eso significa, en las dos direcciones:
Lo que verifiqué: que el diff sobre
maines sólo de tests (con el rango, no con el tip: las PRs de varios commits aplican mal por partes).Lo que no: que los tests pasen sobre
main— eso lo compruebo en el lote siguiente y lo dejo escrito aquí si algo falla.Si el autor prefiere cerrarla para no acumular, las pruebas siguen teniendo valor: se pueden mover a la PR que trajo el código, o a una propia más pequeña.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T07:53:02Z.
Y lo comprobado, como dije: los tests de esta PR pasan sobre
mainde hoy.Y estos 17 no son un aprobado: se saltan porque este equipo no tiene Wine (
pytestda17 skippeden 0,4 s). No puedo decir si pasan; sí puedo decir que no fallan aquí, y esa frase no es lo mismo.Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T08:19:31Z.
Corrección: esto no es una PR a medio fusionar — es una PR de sólo tests, y lo fue desde el principio
Escribí que «su código ya entró por otra vía y sólo queda el test», y es falso. Su diff propio, contra su base, nunca tocó nada fuera de
tests/:Así que el test no es lo que sobra de un cambio ya fusionado: es lo único que la PR ha tenido siempre.
Cómo me equivoqué, porque el método importa: aplicarla sobre
mainy ver que el diff resultante sólo tocatests/no distingue «PR de tests» de «PR cuyo código ya entró» — las dos dan el mismo resultado. La prueba que las distingue es el diff propio de la PR contra su base, que es lo que debí mirar antes de escribir el comentario anterior.Lo que sí sigue en pie: aplicada sobre el
mainde hoy, su fichero de test entra limpio, y los tests pasan (medido: 17 saltados por no haber Wine en esta máquina). Eso es lo que hacía falta saber, y no dependía de mi clasificación.Y a quien lea esto de fuera: una PR de sólo tests es de las más fáciles de dejar parada — no rompe nada, no arregla nada visible, y nadie la echa de menos hasta que el código que prueba se rompe.