From 013802aa743a78100c17e3f797228d2e04bed872 Mon Sep 17 00:00:00 2001 From: curo1305 Date: Thu, 4 Jun 2026 23:11:38 +0200 Subject: [PATCH] fix(06): WR-03 fix locust load test document list shape mismatch The GET /api/documents/ response is {items: [...], total: N, ...} not a bare list. Change docs = resp.json() to resp.json().get("items", []) so get_document task correctly accesses docs[0]["id"] without TypeError. Co-Authored-By: Claude Sonnet 4.6 --- backend/load_tests/locustfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/load_tests/locustfile.py b/backend/load_tests/locustfile.py index d68617b..57f67ee 100644 --- a/backend/load_tests/locustfile.py +++ b/backend/load_tests/locustfile.py @@ -77,7 +77,7 @@ class DocuVaultUser(HttpUser): name="GET /api/documents/ (for get_document)", ) if resp.status_code == 200: - docs = resp.json() + docs = resp.json().get("items", []) if docs: doc_id = docs[0]["id"] self.client.get(