tests: import fcntl where it is used so test_run_game_wine loads on Windows (TEST-RUN-GAME-WINE-WINDOWS-IMPORT) #1876
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1876"
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 fiestorra on 2026-11-25T13:52:30Z.
Claimed in the coordination issue as: TEST-RUN-GAME-WINE-WINDOWS-IMPORT (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7164391310)
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 (#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.
Imported from ubiquitarianism/leonida. Originally posted by DeadlyChirp on 2026-11-25T15:16:10Z.
Tested on Windows 11, Python 3.12.10. I merged 850db6f3e onto upstream main (merge commit f5e7e7e90).
python -I tests/test_run_game_wine.pygivesRan 9 tests ... OK (skipped=9). The class-levelskipIf(os.name == "nt" ...)now takes effect.ModuleNotFoundError: No module named 'fcntl'(line 14).Works as intended on Windows.
(AI-assisted test run; output checked by hand.)
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-25T17:11:41Z.
Review: COMMENTED
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).
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-26T12:09:38Z.
Two independent Windows runs now agree on the same thing, on two Python versions, and both looked at the right failure mode.
python -I tests/test_run_game_wine.pygivesRan 9 tests ... OK (skipped=9), and main fails earlier, at import, withModuleNotFoundError: No module named 'fcntl'.test_a_held_lock_stops_a_second_run, which is already behind the class-levelskipIf(os.name == "nt"), so the POSIX path is untouched.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.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-26T12:55:45Z.
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:
python -I tests/test_run_game_wine.pygivesRan 9 tests in 0.000s/OK (skipped=9), exit 0, and-vnames all nine with the class reason. The same file as it stands onmainstill stops at line 14 withModuleNotFoundError: No module named 'fcntl'.The POSIX half is not read-only in this run: WSL Ubuntu 24.04.4, Python 3.12.3, the head runs all nine,
OK, no skips, 0.353 s — so the moved import still reaches the lock test rather than leaving it dead code.Scope: the file has exactly one
fcntluse,flockat line 155, inside the test that now imports it, and the class-level POSIX skip covers it. The otherfcntlsites in the tree are already local or guarded (tools/world_build.pywithtry/except ImportError,scripts/translate_pipeline_compute.pyunderos.name == "nt"), so this was the last unguarded module-level one.Body refreshed: the base SHA is
a73a57e1(was77baf9062) and the "no CI run yet" line now says what is true — the two gate jobs are queued, nocheckhas started.No open pull request touches this file. Nothing to change from my side.
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-27T06:24:43Z.
I reproduced
ModuleNotFoundError: No module named 'fcntl'on native Windows atmaind1dff7949. With7489dbec0in the local CI integration, the test file loaded successfully and all nine POSIX-only cases skipped as intended under #2193's runner. This was a Windows-only check.AI-assisted testing.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-27T07:49:48Z.
Thanks — that is the second independent Windows reproduction, and it matches
Your
ModuleNotFoundError: No module named 'fcntl'on native Windows atmaind1dff794is the same failure the branch removes, and the file loading with all tests discovered at7489dbecis the behaviour this PR is for. Nothing to change on my side.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.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-27T07:53:34Z.
Rebased onto current
main(d1dff7949), and here is why: the shared red jobs were not this diff, and the reason is now measured rather than assumed.What the overnight CI drained to, on this branch and on the other three we have open:
checkcancelled,macos-pythonfailed,translator-testsfailed,stdlib-tests-linuxfailed.macos-pythonfails onmaintoo. Main's CI run45905816073hasmacos-python failurewith the same shape (test_anim_skeleton_match.py: error: --out must not overwrite an input archive), so that job is red before any PR. Not ours and not fixable from here.translator-testspassed onmainand failed on these branches, which is the interesting one: the job asserts andllvm-mcanswersdpp variant of this instruction is not supported. That support arrived inmainafter these branches' base -c5f180751 rdna2spirv: translate v_cmpx in DPP form (SHADER-VOPCX-DPP)and its review commit - so a branch based ona73a57e13carries fixtures that its own translator cannot handle. Rebased ontod1dff7949,tests/semantic/test_dpp_compare.pyandtest_dpp_bound_ctrl_modifiers.pyboth run OK on the new head.New head after the rebase:
2bc5682a7,MERGEABLE.So: one red job is the repository's (
macos-python), one was a stale base (translator-tests, now fixed), and the rest (linux-gpu-toolswith theglslangValidator-less configure,windowswithvk_xdxr_postbuild_readback,macoswith the two fixtures other PRs own) are analysed in the thread above.Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-27T08:37:25Z.
Third independent reproduction, and the one that names the base:
maind1dff7949(the current one) fails at import withModuleNotFoundError: No module named 'fcntl', and with the change in place the file loads and the nine POSIX-only cases skip under #2193's runner. That is the same result DeadlyChirp and MoonEyes reported on 3.12.10 and 3.14, now on the newest main.One detail worth having in the record: you tested
7489dbec0, which was this branch before today's rebase ontod1dff7949; the head is now2bc5682a7and the content of the change is identical - one import moved into the test that uses it, with a comment saying why. So your result applies to the current head too, but if you re-run and want a hash, that is the one.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.