Shxiao e20b36b3c7
test(artifact-archive): make the archive suite platform-correct on Windows (#5365)
Two tests in this suite failed on Windows hosts for POSIX-shaped reasons:

- test_archive_download_contains_only_presented_files wrote its CSV fixture
  with write_text(), so Windows text mode translated the literal "\n" bytes to
  CRLF; the archive then legitimately contained CRLF while the assertion
  compared against the LF spelling.
- test_archive_rejects_a_path_replaced_during_read swaps the source file with
  os.replace() while the archive still holds it open, which Windows refuses
  with WinError 5, so that rename-under-read race is POSIX-only.

Write the fixture as bytes so its content is platform-independent, and skip
only the rename-based race on Windows: the same-size content change during
read (test_archive_rejects_same_size_content_change_with_restored_mtime) still
runs there and exercises the same mid-read revalidation.

Verified on Windows: both tests red on upstream main, green after the change
(one skipped); ruff check/format clean; the file is 28 passed, 7 skipped.
2026-09-12 07:12:37 +08:00
..