Fix replica auth and idempotency races

This commit is contained in:
Tmribob
2026-11-06 16:13:24 +03:00
parent 57c81ea9d5
commit 057877d299
22 changed files with 682 additions and 60 deletions
+9 -2
View File
@@ -7,13 +7,14 @@ ACTION_SCRIPT ?=
TARGET_INSTANCE_ID ?= api-1
STUDENT_DIR = student-tests
.PHONY: help check validate test load test-persistence test-failover run bootstrap up down test-student explain
.PHONY: help check validate test load test-persistence test-failover run bootstrap up down test-student test-degradation explain research-scale
help:
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
@echo "bootstrap/up/down: local Compose stand; run: API without Docker (needs DATABASE_URL/CACHE_URL)"
@echo "test-student: own functional+race tests; test-persistence: restart stack; test-failover: stop one API replica"
@echo "explain: seed 12k messages and capture EXPLAIN (ANALYZE, BUFFERS) into evidence/"
@echo "research-scale: grade-5 1/2/4 replica experiment; set BASE_URL, DURATION and CONCURRENCY as needed"
check:
$(PYTHON) scripts/check_contract.py
@@ -50,7 +51,13 @@ down:
docker compose --env-file .env down
test-student:
cd $(STUDENT_DIR) && BASE_URL="$(BASE_URL)" $(PYTHON) -B -m unittest -v test_api test_race
cd $(STUDENT_DIR) && BASE_URL="$(BASE_URL)" $(PYTHON) -B -m unittest -v test_api test_race test_idempotency
test-degradation:
cd $(STUDENT_DIR) && BASE_URL="$(BASE_URL)" STUDENT_DOCKER_TESTS=1 $(PYTHON) -B -m unittest -v test_degradation
explain:
sh scripts/explain-history.sh
research-scale:
$(PYTHON) scripts/research-scale.py --base-url "$(BASE_URL)"