Show the other downloader's progress while a prefetch job waits on its lock

This commit is contained in:
J. Nick Koston
2026-09-05 14:05:37 +02:00
parent d1829c495d
commit a875016b1a
4 changed files with 127 additions and 14 deletions
@@ -2353,3 +2353,17 @@ def test_discard_partial_download_logs_undeletable(
):
framework_helpers.discard_partial_download(dest)
assert "Could not remove" in caplog.text
def test_downloaded_bytes_reports_what_is_on_disk(tmp_path: Path) -> None:
"""A landed file counts in full, a part file counts what it holds
(never more than the size), and nothing on disk counts zero."""
dest = tmp_path / "archive"
assert framework_helpers.downloaded_bytes(dest, 4) == 0
part = tmp_path / "archive.part"
part.write_bytes(b"ab")
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