Skip to content
This repository was archived by the owner on Apr 5, 2026. It is now read-only.

Commit f0625a6

Browse files
committed
test: assert minimum download throughput to catch DRS throttling
Files >= 20 MB must download at >= 3 MB/s. The DRS delay bug (v3.5.0) throttled to ~2 MB/s — this floor catches the regression while tolerating CI network variability.
1 parent eb22417 commit f0625a6

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tests/test_direct_e2e.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@
4646
# Per-file download timeouts (seconds).
4747
DOWNLOAD_TIMEOUTS = {"1mb": 60, "20mb": 180, "100mb": 600}
4848

49+
# Minimum acceptable throughput (MB/s) for files >= 20 MB.
50+
# The DRS delay bug (v3.5.0) throttled downloads to ~2 MB/s.
51+
# This floor catches the regression while tolerating CI network variability.
52+
MIN_THROUGHPUT_MBPS = 3.0
53+
4954

5055
def _patch_telethon_faketls():
5156
"""Patch TelethonFakeTLS bugs.
@@ -153,6 +158,16 @@ async def _download_test_files(client, transport_label):
153158
continue
154159

155160
throughput_mb = len(data) / elapsed / 1048576
161+
162+
# Assert minimum throughput for large files to catch DRS throttling.
163+
if info["size"] >= 20 * 1048576 and throughput_mb < MIN_THROUGHPUT_MBPS:
164+
print(f" [{transport_label}] {label}: FAIL — "
165+
f"throughput {throughput_mb:.2f} MB/s < "
166+
f"{MIN_THROUGHPUT_MBPS} MB/s minimum "
167+
f"(DRS delay regression?)")
168+
all_ok = False
169+
continue
170+
156171
print(f" [{transport_label}] {label}: OK — "
157172
f"{elapsed:.1f}s, {throughput_mb:.1f} MB/s")
158173

0 commit comments

Comments
 (0)