fix: review findings (async SQS dispatcher, backoff, batch insert, shutdown order, pagination, HMAC) + loadtest fixes; v0.1.6

This commit is contained in:
“Naeel”
2026-08-16 18:24:09 +04:00
parent 090cedca67
commit 3fedf9317c
27 changed files with 581 additions and 122 deletions
+15 -4
View File
@@ -28,11 +28,22 @@ class Verifier:
def device_report(self, device_id, expected):
"""Сверка по одному устройству. expected — сколько seq ждали.
Ограничение: API отдаёт максимум 1000 строк на устройство —
сценарии должны укладывать expected в ~900 на устройство."""
rows = self.api.telemetry(self.ns, device_id=device_id, limit=1000)
Пагинация по 50 строк: шлюз платформы рвёт ответы >~15 КБ
(баг MSS/MTU, тикет Nubes) — большие страницы НЕ использовать."""
rows = []
offset = 0
pages = 0
while pages < 40:
page = self.api.telemetry(self.ns, device_id=device_id,
limit=50, offset=offset)
items = page.get("items", [])
rows.extend(items)
pages += 1
offset += 50
if len(items) < 50 or len(rows) >= max(expected + 100, 200):
break
seqs = {}
for r in rows.get("items", []):
for r in rows:
p = r.get("payload") or {}
if p.get("run_id") != self.run_id:
continue