Prefer the landed archive while waiting, cap credited bytes, and give the registry wait a deadline

This commit is contained in:
J. Nick Koston
2026-09-05 14:59:01 +02:00
parent 562e5079d1
commit c31e02fa0c
7 changed files with 128 additions and 52 deletions
+6 -4
View File
@@ -2356,7 +2356,7 @@ def test_discard_partial_download_logs_undeletable(
def test_downloaded_bytes_reports_what_is_on_disk(tmp_path: Path) -> None:
"""Landed file: size; part file: its bytes, capped at size; nothing: 0."""
"""Part file first, then the landed file, both capped at size; else 0."""
dest = tmp_path / "archive"
assert framework_helpers.downloaded_bytes(dest, 4) == 0
part = tmp_path / "archive.part"
@@ -2364,7 +2364,9 @@ def test_downloaded_bytes_reports_what_is_on_disk(tmp_path: Path) -> None:
assert framework_helpers.downloaded_bytes(dest, 4) == 2
part.write_bytes(b"abcdef")
assert framework_helpers.downloaded_bytes(dest, 4) == 4
dest.write_bytes(b"abcd")
assert framework_helpers.downloaded_bytes(dest, 4) == 4
part.unlink()
assert framework_helpers.downloaded_bytes(dest) == 4
dest.write_bytes(b"abc")
assert framework_helpers.downloaded_bytes(dest, 4) == 3
assert framework_helpers.downloaded_bytes(dest) == 3
dest.write_bytes(b"abcdef")
assert framework_helpers.downloaded_bytes(dest, 4) == 4