Skip to content

run_wine_tests: keep one wineserver, disable winedbg, add --jobs (TEST-WINE-FAST) - #1354

Merged
aslan2142 merged 1 commit into
ProjectLeonida:mainfrom
aslan2142:wine-tests-fast
Nov 24, 2026
Merged

aslan2142 merged 1 commit into
ProjectLeonida:mainfrom
aslan2142:wine-tests-fast

Conversation

@aslan2142

Copy link
Copy Markdown
Collaborator

Claimed in the coordination issue as: TEST-WINE-FAST (#14 (comment))

Depends on: none. #919, #999 and #1015 also change scripts/run_wine_tests.py: #919 merges cleanly with this branch; #999 (the docstring, the results loop in main()) and #1015 (the imports, positive_seconds/--timeout) give small textual conflicts.

What and why

Under Wine, each Windows test took several seconds, most of it a wineserver starting and stopping around every test.

  • Kept-alive wineserver. The runner keeps one wineserver for the run (wineserver -p; $WINESERVER, else the one next to --wine, else the one on PATH) and stops it with -k at the end, also after a failure or Ctrl+C. If a server is still shutting down, it waits for it first. A server someone else started with -p is used and left running. With no wineserver found, it prints one line and carries on.
  • wineboot warm-up. After starting the server it runs wine wineboot with no output. The first program a server runs starts the prefix's services, which inherit its stdout. With a kept server they hold the first test's pipe open until the timeout (measured: 120 s).
  • Overrides. Each test's WINEDLLOVERRIDES gets winedbg.exe=d (a crash fails at once instead of waiting in the debugger) and winemenubuilder.exe=d (no .desktop files or MIME entries in the user's profile). An entry of the caller's or of the test's CTest ENVIRONMENT for the same program wins.
  • --jobs N (default 1, output unchanged). RUN_SERIAL tests run alone, tests sharing a RESOURCE_LOCK never overlap, and DEPENDS and fixtures are kept. Verdicts and the summary come out in the same order as with --jobs 1.
  • docs/testing.md: the fast local recipe for the cross-build, the measured times, the menu-builder note, a pointer to "Known problems" for tests that share temp files, and --jobs.

Tested

Wine 11.22 (Staging) on Linux under xvfb-run, llvmpipe only, with a clang-cl (xwin) build of recent main. No game files.

| 40 tests with ctest (-R '^(d3d12_[a-c]|vk_[a-d]|xg)'), one setting added at a time | Seconds |
|---|---|
| one test after another, as the docs say today | 179 |
| wineserver -p without the warm-up (the first test hung for 120 s) | 155 |
| wineserver -p with the wineboot warm-up | 35 |
| and WINEDEBUG=-all, then winedbg.exe=d (no test crashed, so no change) | 35 |
| and ctest -j 6 | 5.6 |

  • The runner itself on that build: 32 s with --jobs 1 and 6.2 s with --jobs 6 for those 40 tests, with the same verdicts in the same order. All 312 tests took 19 s with --jobs 6.
  • tests/test_run_wine_tests.py: 72 tests pass; the 9 new ones each fail or error against main's script.
  • test_text_write_line_endings, test_tool_stdout_encoding, all 12 test_docs_* and check_no_game_data.py on the changed files pass.
  • Not tested: the CI wine job itself (it runs the MSVC build's artifact), and Wine versions other than 11.22.

GPUs tested: n/a (Mesa llvmpipe, software Vulkan)

AI-assisted: yes (Claude Code, Claude Opus 5.5)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator rule.)

Run one after another, each Windows test under Wine took several seconds,
most of it a wineserver starting and stopping around every test. The
runner now keeps one wineserver alive for the run (`wineserver -p`, the
one $WINESERVER or the --wine command uses) and stops it at the end,
also after a failure or Ctrl+C. It starts the prefix's services first
with `wine wineboot` and no output: the first program a server runs
starts them, they inherit its output pipe, and with a kept server they
hold it open until the timeout.

Each test's WINEDLLOVERRIDES gains winedbg.exe=d (a crash fails at once
instead of waiting in the debugger) and winemenubuilder.exe=d (no menu
entries or file associations in the user's profile); an entry of the
caller's or the test's for the same program wins.

--jobs N (default 1) runs N tests at a time, keeping RUN_SERIAL tests
alone, tests that share a RESOURCE_LOCK apart and DEPENDS in order, and
reports them in the same order as --jobs 1.

docs/testing.md gains the fast local recipe for the cross-build with
measured times, the menu-builder note and --jobs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aslan2142
aslan2142 merged commit 51a6074 into ProjectLeonida:main Nov 24, 2026
5 checks passed
@aslan2142

Copy link
Copy Markdown
Collaborator Author

Merged by me although it is my own PR: the local Windows check under Wine is what every runtime/ review and every rung of the boot stack now waits on, and this is what makes it take a minute instead of half an hour. It changes the test runner, its unit test and docs/testing.md only, nothing in runtime/.

Checked on main b6204ecdf + de3027cff (merges cleanly):

  • tests/test_run_wine_tests.py: 72 tests pass. The 9 new ones fail or error against main's script.
  • All 12 test_docs_*, test_text_write_line_endings and test_tool_stdout_encoding pass.
  • check_no_game_data.py on the three changed files: clean.
  • Measured with Wine 11.22 on llvmpipe (in the description): 40 tests go from 179 s to 5.6 s with ctest, and all 312 tests take 19 s through the runner with --jobs 6.

Not tested: the CI wine job itself, and Wine versions other than 11.22. --jobs defaults to 1, so that job's output is unchanged; the kept server, the wineboot warm-up and the two overrides do apply there. If the job misbehaves, say so here and I'll fix it forward or revert.

Heads-up for #999 and #1015: both now conflict with main in scripts/run_wine_tests.py, in small textual ways (#999: the docstring and the results loop in main(); #1015: the imports and around positive_seconds/--timeout). #919 still merges cleanly.

AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant