Repository navigation
tests: import fcntl where it is used so test_run_game_wine loads on Windows (TEST-RUN-GAME-WINE-WINDOWS-IMPORT) - #1876
Conversation
|
Tested on Windows 11, Python 3.12.10. I merged 850db6f onto upstream main (merge commit f5e7e7e90).
Works as intended on Windows. (AI-assisted test run; output checked by hand.) |
MoonEyes
left a comment
There was a problem hiding this comment.
Independent test report (Windows 11, Python 3.14, origin/main + PR head).
Verdict: LGTM
Ran tests/test_run_game_wine.py on Windows. origin/main: collection error (ModuleNotFoundError: No module named 'fcntl' at line 14), so the class-level POSIX skip never gets a chance to run. PR head: 9 skipped, no error.
The import is now local to test_a_held_lock_stops_a_second_run, which is already behind the class skip, so POSIX behaviour is unchanged. The comment explains why. I could not run the POSIX path here (no Wine/Linux), so that part is read-only.
AI-assisted: yes (Claude Code ran the tests; I read them).
850db6f to
7489dbe
Compare
|
Two independent Windows runs now agree on the same thing, on two Python versions, and both looked at the right failure mode.
That is the whole claim of the change, and both of you checked the part that matters: the skip now takes effect instead of the module dying before it can. What neither run covers, and nothing in this PR changes: the POSIX path itself (it needs Linux or Wine, as MoonEyes says). The change moves an import and records why; it does not touch a test that runs there. Nothing to adjust on my side. Thank you both for taking the time - a single-file test fix is exactly the kind of change that is easy to get wrong for the platform nobody is sitting on. Written with an AI assistant. |
|
Third independent run, Windows and POSIX, and the body now matches Windows 11 Pro 10.0.26300, Python 3.11.0, the head alone in a clean worktree: The POSIX half is not read-only in this run: WSL Ubuntu 24.04.4, Python 3.12.3, the head runs all nine, Scope: the file has exactly one Body refreshed: the base SHA is No open pull request touches this file. Nothing to change from my side. Written with an AI assistant. |
|
I reproduced AI-assisted testing. |
|
Thanks — that is the second independent Windows reproduction, and it matches Your For the record, the POSIX half was checked too (WSL Ubuntu 24.04, Python 3.12): the nine tests run and pass with no skips, so the import that moved is still reached by the test that uses it rather than being dead weight behind the class skip. Written with an AI assistant. |
…the file loads on Windows
7489dbe to
2bc5682
Compare
|
Rebased onto current What the overnight CI drained to, on this branch and on the other three we have open:
New head after the rebase: So: one red job is the repository's ( Written with an AI assistant. |
|
Third independent reproduction, and the one that names the base: One detail worth having in the record: you tested What none of the three runs covers, and this change does not touch: the POSIX path itself. It moves an import and records the reason; it does not alter a test that runs on Linux or under Wine. Written with an AI assistant. |
Claimed in the coordination issue as: TEST-RUN-GAME-WINE-WINDOWS-IMPORT (#1608 (comment))
What and why
tests/test_run_game_wine.pycould not be imported on Windows:import fcntlsat at module level (line 14), and the file is one of the eight that thecheckjob'spython -Iloop onwindows-latestruns. The class already carries@unittest.skipIf(os.name == "nt" or not shutil.which("bash"), "a POSIX bash launcher"), but the skip cannot take effect when the import fails first, so the loop stopped on this file withModuleNotFoundError: No module named 'fcntl'.The change moves the import into the single test that uses it (
test_a_held_lock_stops_a_second_run, which locksself.lockwithfcntl.flock). That test is already gated by the class-level POSIX skip, so behaviour on Linux and macOS is unchanged. No test is disabled and no assertion is loosened.This does not turn the whole Windows job green on its own: the other seven files the loop fails are covered by #1792 (three tools' repr'd paths), #1561 (the dead
test_feature_scantest andcompute_heap_layout_census), #1837 and #1789 (stdout guards), and the standing claims TEST-WINE-JOBS-TIMING-WINDOWS and CI-RUNTIME-PATHS-CONFORMANCE.Tested
Windows 11, Windows Python 3.13.14,
maina73a57e1, native (no Wine, no GPU):python -I tests/test_run_game_wine.py-> exit 1,Traceback ... line 14, in <module> / import fcntl / ModuleNotFoundError: No module named 'fcntl'.python -I tests/test_run_game_wine.py->Ran 9 tests in 0.000s / OK (skipped=9), exit 0;-vlists the nine skips with the class's reason, so the file is discovered and skipped rather than silently absent.python -m compileall -q tests/test_run_game_wine.py-> exit 0.python3 -I tests/test_run_game_wine.py->Ran 9 tests in 0.340s / OK, no skips, so the POSIX path this change moves the import into still runs all nine tests.tests/test_runner_calls_all_tests.pystill reports only the pre-existingtest_feature_scan.pyentry (Fix two repository checks that fail on main #1561), nothing about this file.check-no-game-data-> the tree is clean.Not covered: macOS. The two gate jobs (
change-scope,no-game-data) are queued, as the repository's queue has been for hours; nocheckhas started.GPUs tested: n/a
AI-assisted: yes (DeepSeek Harness).
Checklist
main(a73a57e1) and merges cleanly.docs/design.md, with how it was confirmed. (n/a: no translator change)Written with an AI assistant.