tests: block destination path in rpf9dump write-failure exit-code tests (TEST-RPF9DUMP-WRITE-BLOCKER) #655

Merged
kirigayakazima merged 1 commit from upstream-pr/655 into main 2026-11-24 13:09:34 +00:00
kirigayakazima commented 2026-11-24 11:03:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-24T11:03:27Z.


Claimed in the coordination issue as: TEST-RPF9DUMP-WRITE-BLOCKER (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7129571335)

What and why

Fixes 2 tests in tests/test_rpf9dump_exit_codes.py that currently fail on main (21625bca):

  • test_failed_xma_write_exits_nonzero_and_rerun_completes
  • test_failed_texture_write_exits_nonzero_and_withholds_manifest

Commit b05999eb (origin PR 8969) changed Util.WriteAtomic in tools/rpf9dump/Util.cs to stage writes to Util.PartialName(path) (<path>.<pid>.<tid>.<guid>.partial) instead of <path>.partial. Because the destination is no longer blocked by a <target>.partial directory, both tests exited 0 on unmodified main.

Following tests/test_ttpf_export_resume.py:69, block the destination path itself with a directory (where File.Exists is false and Util.MoveReplace fails), verify no leaked *.partial temp files remain, and confirm retry succeeds once the directory blocker is removed.

Tested

On Windows 11 x64 (.NET 8.0.401, Python 3.14.7) at 68fd157f54892629049f205093383cf27df1e077, synthetic archives only (no game data):

  • Before fix on upstream/main (21625bca): python -I tests/test_rpf9dump_exit_codes.py failed 2/8 (the two write-blocker tests above exited 0)
  • dotnet build tools/rpf9dump/rpf9dump.csproj -c Release — 0 warnings, 0 errors
  • RPF9DUMP_DLL=... python -I tests/test_rpf9dump_exit_codes.py — 8 ran, OK
  • python -I tests/test_ci_registration.py — 15 ran, OK
  • python -I tests/test_text_write_line_endings.py — 3 ran, OK
  • python -I tests/test_check_no_game_data.py & python -I scripts/check_no_game_data.py — OK / exit 0
  • python -m compileall -q tests/test_rpf9dump_exit_codes.py — exit 0

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main (21625bca) 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. (n/a — tests only)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5470910844 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/655). Originally posted by [kirigayakazima](https://github.com/kirigayakazima) on 2026-11-24T11:03:27Z. --- Claimed in the coordination issue as: TEST-RPF9DUMP-WRITE-BLOCKER (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7129571335) ### What and why Fixes 2 tests in `tests/test_rpf9dump_exit_codes.py` that currently fail on `main` (`21625bca`): - `test_failed_xma_write_exits_nonzero_and_rerun_completes` - `test_failed_texture_write_exits_nonzero_and_withholds_manifest` Commit `b05999eb` (origin PR 8969) changed `Util.WriteAtomic` in `tools/rpf9dump/Util.cs` to stage writes to `Util.PartialName(path)` (`<path>.<pid>.<tid>.<guid>.partial`) instead of `<path>.partial`. Because the destination is no longer blocked by a `<target>.partial` directory, both tests exited `0` on unmodified `main`. Following `tests/test_ttpf_export_resume.py:69`, block the destination path itself with a directory (where `File.Exists` is `false` and `Util.MoveReplace` fails), verify no leaked `*.partial` temp files remain, and confirm retry succeeds once the directory blocker is removed. ### Tested On Windows 11 x64 (`.NET 8.0.401`, `Python 3.14.7`) at `68fd157f54892629049f205093383cf27df1e077`, synthetic archives only (no game data): - Before fix on `upstream/main` (`21625bca`): `python -I tests/test_rpf9dump_exit_codes.py` failed 2/8 (the two write-blocker tests above exited 0) - `dotnet build tools/rpf9dump/rpf9dump.csproj -c Release` — 0 warnings, 0 errors - `RPF9DUMP_DLL=... python -I tests/test_rpf9dump_exit_codes.py` — 8 ran, OK - `python -I tests/test_ci_registration.py` — 15 ran, OK - `python -I tests/test_text_write_line_endings.py` — 3 ran, OK - `python -I tests/test_check_no_game_data.py` & `python -I scripts/check_no_game_data.py` — OK / exit 0 - `python -m compileall -q tests/test_rpf9dump_exit_codes.py` — exit 0 GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` (`21625bca`) and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] 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. (n/a — tests only)
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!655
No description provided.