forked from mtusi2026/mtusi2026lab3
Lab 3: HAProxy + 2 replicas, idempotency, graceful shutdown, track 1
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# 2026-11-03T09:51:16Z commit=n/a host=Linux 6.18.44-fc-v230 x86_64 cpus=2
|
||||
$ python3 student-tests/test_idempotency.py
|
||||
## idempotency across replicas (http://127.0.0.1:8080)
|
||||
PASS sequential replays: same 201 + same Message from different replicas 0.29s replicas=2, rows=1
|
||||
PASS 30 concurrent POSTs, same key + body, via LB -> exactly one message 0.63s per-replica responses {'api-7e27119d': 15, 'api-5dbb8cd6': 15}, rows=1
|
||||
PASS concurrent same key, two different bodies -> one message, others 201-same or 409 0.78s 201x10, 409x10
|
||||
PASS after commit: different body -> 409; reordered/whitespace JSON -> replay 0.04s
|
||||
PASS scope: user + chat + key (same key elsewhere is independent) 0.03s
|
||||
PASS key format: missing/empty/129 chars/invalid -> 400; 128 chars ok 0.05s
|
||||
PASS failed attempt does not claim the key (400/404 not recorded) 0.02s
|
||||
PASS replay re-checks session and access 0.34s
|
||||
PASS key older than IDEMPOTENCY_TTL_SECONDS is reusable (24 h window) 0.49s
|
||||
summary: 9 passed, 0 failed
|
||||
exit=0
|
||||
Reference in New Issue
Block a user