[PR #249] test: exercise AWC manifest staged cleanup on all hosts #300

Open
opened 2026-11-26 20:17:26 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/249
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/9983


📝 Commits (1)

  • 6c8151d test: exercise AWC manifest staged cleanup on all hosts

📊 Changes

1 file changed (+11 additions, -8 deletions)

View changed files

📝 tests/test_awc_manifest.py (+11 -8)

📄 Description

Carried over from old PR 9983 by WebIdentity1 in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9983, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
WebIdentity1: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116927597

What and why

test_failed_replace_of_read_only_manifest_removes_writable_temp made the destination read-only before calling write_manifest. On macOS the preliminary os.open(destination, os.O_WRONLY) correctly rejects that destination, so the test failed before it could exercise staged-file cleanup. The test now keeps the destination writable, makes the synthetic staged file read-only inside the failed-replace callback, and verifies the cleanup restores its writable mode, leaves the previous manifest intact, and removes the temporary file. Production code is unchanged.

Tested

macOS, Python 3.12, synthetic AWC data only; no GPU or game files:

  • Baseline python3.12 -I tests/test_awc_manifest.py: 1 failure of 22 at the staged cleanup assertion.
  • Head python3.12 -I tests/test_awc_manifest.py: 22/22 pass.
  • Related suites: test_file_mode.py 5 pass; test_replace_retry.py 8 pass/2 expected skips; test_awc_names.py 35 pass/1 expected skip; test_awc_shorts.py 15 pass/1 expected skip.
  • python3.12 -I scripts/check_no_game_data.py tests/test_awc_manifest.py, python3.12 -m compileall -q tests/test_awc_manifest.py, and git diff --check pass.

AI-assisted: yes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/249 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9983` --- ### 📝 Commits (1) - [`6c8151d`](https://github.com/ubiquitarianism/leonida/commit/6c8151d6e1a8e6e45bcd93f369e3aa05312496ec) test: exercise AWC manifest staged cleanup on all hosts ### 📊 Changes **1 file changed** (+11 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_awc_manifest.py` (+11 -8) </details> ### 📄 Description > Carried over from **old PR 9983** by `WebIdentity1` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9983`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `WebIdentity1`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116927597 ### What and why `test_failed_replace_of_read_only_manifest_removes_writable_temp` made the destination read-only before calling `write_manifest`. On macOS the preliminary `os.open(destination, os.O_WRONLY)` correctly rejects that destination, so the test failed before it could exercise staged-file cleanup. The test now keeps the destination writable, makes the synthetic staged file read-only inside the failed-replace callback, and verifies the cleanup restores its writable mode, leaves the previous manifest intact, and removes the temporary file. Production code is unchanged. ### Tested macOS, Python 3.12, synthetic AWC data only; no GPU or game files: - Baseline `python3.12 -I tests/test_awc_manifest.py`: 1 failure of 22 at the staged cleanup assertion. - Head `python3.12 -I tests/test_awc_manifest.py`: 22/22 pass. - Related suites: `test_file_mode.py` 5 pass; `test_replace_retry.py` 8 pass/2 expected skips; `test_awc_names.py` 35 pass/1 expected skip; `test_awc_shorts.py` 15 pass/1 expected skip. - `python3.12 -I scripts/check_no_game_data.py tests/test_awc_manifest.py`, `python3.12 -m compileall -q tests/test_awc_manifest.py`, and `git diff --check` pass. AI-assisted: yes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#300
No description provided.