Honor CTest fixture cleanup ordering in the Wine runner #1946

Merged
lgr123 merged 1 commit from upstream-pr/1946 into main 2026-11-28 23:49:29 +00:00
lgr123 commented 2026-11-25 16:25:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lgr123 on 2026-11-25T16:25:07Z.


Claimed as WINE-RUNNER-FIXTURE-CLEANUP in #1608.

This is a fallback for listings that retain FIXTURES_* metadata but omit CTest’s generated DEPENDS edges. In that shape, an early-listed cleanup ran before setup and consumers with both --jobs 1 and --jobs 2. I haven’t identified a supported CTest version or a current CI producer that emits that shape. The standard ctest --show-only=json-v1 export already preserves those edges on CTest 3.24.3 and 4.3.1-msvc1, as reported in the independent review.

This patch adds teardown ordering edges without adding failed-setup gates to cleanup. A cleanup shared by two fixtures waits for both setups and all consumers, then runs once. The regressions cover serial and parallel execution, failed setup, failed consumer and skipped setup.

Tested

  • Windows, Python 3.12.14, CPU-only synthetic subprocesses. All 8 tests in tests/test_run_wine_test_fixtures.py passed after rebasing onto 9e7720c.
  • The broader Windows runner suite has pre-existing shared-trace errors in two concurrency tests. I reproduced both on pristine public main in repeated runs. The new tests write one trace file per child.
  • git diff --check and the source-only policy check passed. No game files were used.

GPUs tested: n/a.

AI-assisted: yes.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5495057973 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1946). Originally posted by [lgr123](https://github.com/lgr123) on 2026-11-25T16:25:07Z. --- Claimed as `WINE-RUNNER-FIXTURE-CLEANUP` in [#1608](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7167793106). This is a fallback for listings that retain `FIXTURES_*` metadata but omit CTest’s generated `DEPENDS` edges. In that shape, an early-listed cleanup ran before setup and consumers with both `--jobs 1` and `--jobs 2`. I haven’t identified a supported CTest version or a current CI producer that emits that shape. The standard `ctest --show-only=json-v1` export already preserves those edges on CTest 3.24.3 and 4.3.1-msvc1, as reported in the independent review. This patch adds teardown ordering edges without adding failed-setup gates to cleanup. A cleanup shared by two fixtures waits for both setups and all consumers, then runs once. The regressions cover serial and parallel execution, failed setup, failed consumer and skipped setup. ### Tested - Windows, Python 3.12.14, CPU-only synthetic subprocesses. All 8 tests in `tests/test_run_wine_test_fixtures.py` passed after rebasing onto `9e7720c`. - The broader Windows runner suite has pre-existing shared-trace errors in two concurrency tests. I reproduced both on pristine public main in repeated runs. The new tests write one trace file per child. - `git diff --check` and the source-only policy check passed. No game files were used. GPUs tested: n/a. AI-assisted: yes.
alexandersato0830 commented 2026-11-25 16:40:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by alexandersato0830 on 2026-11-25T16:40:31Z.

Review: COMMENTED


I independently checked the Wine runner at 4d0536490. All eight tests in tests/test_run_wine_test_fixtures.py passed on Windows 11 with Python 3.11.17.

I also compared a nested fixture against native CTest. The inner setup and cleanup require an outer fixture, and the inner fixture has two consumers, one deliberately slow. I ran the success, failed consumer, failed inner setup, skipped inner setup, and failed outer setup cases with one and three workers.

  • CTest 3.24.3 and 4.3.1-msvc1 both emit the fixture edges in ctest --show-only=json-v1, the same command the runtime workflow uses. For example, inner_cleanup already has DEPENDS entries for outer_setup, inner_setup, and both consumers. With all JSON properties intact, both 9e7720c9e and 4d0536490 matched native CTest's launch set and required ordering in all ten cases per version.
  • With only the generated DEPENDS properties removed, the base runner got cleanup ordering wrong in all ten cases per version. The proposed runner still matched native CTest. The test commands were adapted to launch synthetic Python stand-ins.

Could the PR description call out that this fixes listings without the generated DEPENDS edges? If a CTest version or another producer emits that shape in practice, naming it would help establish which runs are affected.

AI-assisted review with Codex. CPU-only synthetic tests. No game files used.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6061350449 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1946#pullrequestreview-6061350449). Originally posted by [alexandersato0830](https://github.com/alexandersato0830) on 2026-11-25T16:40:31Z. **Review:** COMMENTED --- I independently checked the Wine runner at `4d0536490`. All eight tests in `tests/test_run_wine_test_fixtures.py` passed on Windows 11 with Python 3.11.17. I also compared a nested fixture against native CTest. The inner setup and cleanup require an outer fixture, and the inner fixture has two consumers, one deliberately slow. I ran the success, failed consumer, failed inner setup, skipped inner setup, and failed outer setup cases with one and three workers. - CTest 3.24.3 and 4.3.1-msvc1 both emit the fixture edges in `ctest --show-only=json-v1`, the same command the runtime workflow uses. For example, `inner_cleanup` already has `DEPENDS` entries for `outer_setup`, `inner_setup`, and both consumers. With all JSON properties intact, both `9e7720c9e` and `4d0536490` matched native CTest's launch set and required ordering in all ten cases per version. - With only the generated `DEPENDS` properties removed, the base runner got cleanup ordering wrong in all ten cases per version. The proposed runner still matched native CTest. The test commands were adapted to launch synthetic Python stand-ins. Could the PR description call out that this fixes listings without the generated `DEPENDS` edges? If a CTest version or another producer emits that shape in practice, naming it would help establish which runs are affected. AI-assisted review with Codex. CPU-only synthetic tests. No game files used.
zmasi commented 2026-11-28 12:21:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T12:21:41Z.


#1946 | head 4d05364902 (merged cleanly with main d48a957bb) | python -I tests/test_run_wine_test_fixtures.py | red on main: FAILED (failures=7) (cleanup executed ahead of setup/consumer and other_consumer across --jobs 1 and --jobs 2) | green on PR+main: 8 tests OK | Windows 11, Python 3.12.10 | AI-assisted: yes

Audited fixture_dependencies and main in scripts/run_wine_tests.py (separating required_setups success gates from cleanup_order ordering dependencies so FIXTURES_CLEANUP tests wait for all matching setups and consumers across single- and multi-job runs, and still execute after failed or skipped fixture work without inheriting setup-failure blocks). Also verified tests/test_ci_registration.py (18 OK), tests/test_text_write_line_endings.py (3 OK), and scripts/check_no_game_data.py.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7239173620 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1946#issuecomment-7239173620). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T12:21:41Z. --- #1946 | head 4d0536490285fd0449330e57d6012f6cfc8bdd18 (merged cleanly with main d48a957bb) | `python -I tests/test_run_wine_test_fixtures.py` | red on main: `FAILED (failures=7)` (`cleanup` executed ahead of `setup`/`consumer` and `other_consumer` across `--jobs 1` and `--jobs 2`) | green on PR+main: `8 tests OK` | Windows 11, Python 3.12.10 | AI-assisted: yes Audited `fixture_dependencies` and `main` in `scripts/run_wine_tests.py` (separating `required_setups` success gates from `cleanup_order` ordering dependencies so `FIXTURES_CLEANUP` tests wait for all matching setups and consumers across single- and multi-job runs, and still execute after failed or skipped fixture work without inheriting setup-failure blocks). Also verified `tests/test_ci_registration.py` (`18 OK`), `tests/test_text_write_line_endings.py` (`3 OK`), and `scripts/check_no_game_data.py`.
TheGeogeo commented 2026-11-28 23:38:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-28T23:38:18Z.


Tested 4d0536490 merged (no commit) with main aa918e5d9: Python 3.12.4, Windows 11 10.0.26300, CPU only. check_no_game_data.py is clean.

  • Green: tests/test_run_wine_test_fixtures.py, 8 tests pass. This test needs neither Wine nor bash.
  • Red: with scripts/run_wine_tests.py back to main, all 8 fail ('other_consumer' != 'cleanup').

No blocker from my side.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247563903 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1946#issuecomment-7247563903). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-28T23:38:18Z. --- Tested `4d0536490` merged (no commit) with `main` `aa918e5d9`: Python 3.12.4, Windows 11 10.0.26300, CPU only. `check_no_game_data.py` is clean. - Green: `tests/test_run_wine_test_fixtures.py`, 8 tests pass. This test needs neither Wine nor `bash`. - Red: with `scripts/run_wine_tests.py` back to `main`, all 8 fail (`'other_consumer' != 'cleanup'`). No blocker from my side. AI-assisted (Claude Code).
MoonEyes commented 2026-11-28 23:49:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T23:49:32Z.


Merged after TheGeogeo's red/green check (check) (Windows, Python tests, no GPU needed) and a local re-check here. Merged after local re-verification: this PR merged onto main cd36c87b1 without conflict, and its test file(s) (tests/test_run_wine_test_fixtures.py) pass there. Earlier today the same tests failed on main without the PR (red/green) and a bundle with other open PRs showed no new failures. check_no_game_data.py is clean. Windows 11, Python 3.14; no GPU needed for these tests.

AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247688111 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1946#issuecomment-7247688111). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T23:49:32Z. --- Merged after **TheGeogeo**'s red/green check ([check](https://github.com/ProjectLeonida/mandy/pull/1946#issuecomment-7247563903)) (Windows, Python tests, no GPU needed) and a local re-check here. Merged after local re-verification: this PR merged onto `main` cd36c87b1 without conflict, and its test file(s) (`tests/test_run_wine_test_fixtures.py`) pass there. Earlier today the same tests failed on `main` without the PR (red/green) and a bundle with other open PRs showed no new failures. `check_no_game_data.py` is clean. Windows 11, Python 3.14; no GPU needed for these tests. _AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes._
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1946
No description provided.