test: delete slow, timing-based and redundant tests

This commit is contained in:
imSp4rky
2026-12-05 15:20:05 -07:00
parent 783a2fc185
commit 3a0a74e694
292 changed files with 153 additions and 15174 deletions
-33
View File
@@ -156,20 +156,6 @@ def test_tail_boost_split_produces_byte_identical_segment(server, tmp_path):
assert not list(tmp_path.glob("*.tp.!dev"))
def test_tail_boost_finalize_last_part_wins(server, tmp_path):
files, _ = run(server, tmp_path, seg_urls(server))
assert boost_engaged(server), "tail boost never engaged; finalize path untested"
assert len(files) == SEG_COUNT
# last part wins: the pre-truncated .tp.!dev is os.replace'd into save_path, leaving no target
assert not list(tmp_path.glob("*.tp.!dev"))
for path in ranged_counts(server):
i = int(path.removeprefix("/seg").removesuffix(".bin"))
save_path = tmp_path / f"seg_{i:04}.bin"
assert save_path.exists()
assert not save_path.with_name(f"{save_path.name}.tp.!dev").exists()
def test_tail_boost_part_failure_falls_back_to_normal_path(server, tmp_path, monkeypatch):
server.break_offset_ranges = True # every part window past the first fails, but not for good
monkeypatch.setattr(dl, "RETRY_WAIT", 0.01)
@@ -187,25 +173,6 @@ def test_tail_boost_part_failure_falls_back_to_normal_path(server, tmp_path, mon
assert not list(tmp_path.glob("*.tp.!dev"))
def test_tail_boost_failure_does_not_abort_sibling_segments(server, tmp_path, monkeypatch):
server.break_offset_ranges = True
monkeypatch.setattr(dl, "RETRY_WAIT", 0.01)
files, _ = run(server, tmp_path, seg_urls(server))
assert boost_engaged(server), "tail boost never engaged; the fallback path is untested"
# the parts of one segment share an abort of their own: setting the batch-wide one would
# strand every other in-flight worker and end the batch with segments missing
assert len(files) == SEG_COUNT
with server.lock:
reqs = list(server.requests)
boosted_paths = {path for path, rng in reqs if rng and rng != "bytes=0-0"}
assert boosted_paths
# each boosted segment went back on the normal path: a plain unranged GET for it
plain = {path for path, rng in reqs if rng is None}
assert boosted_paths <= plain
def test_tail_boost_permanent_part_failure_still_fails_the_batch(server, tmp_path, monkeypatch):
server.deny_offset_ranges = True # every part window past the first is a 403
monkeypatch.setattr(dl, "RETRY_WAIT", 0.01)