Files
mtusi2026lab3/evidence/tests/test-isolated.md
T
ricoromaandClaude Opus 5.5 de93056eab docs: add replicas-lb evidence and report
Evidence from 4e0cc4e: stand ports, limits and per-service env,
X-Instance-Id distribution and scaling, LB-generated errors,
test-persistence through the LB, test-failover for each replica in stop
and kill modes, stop-one refusals, test runs and bench self-checks.
REPORT.md gains the LB architecture, timeout chain, limits, criteria
rows and defence answers. Coverage exclusions for restart now point to
the lab 3 persistence evidence; stale lab 2 pointers go to
KNOWN_ISSUES.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 18:31:18 +03:00

58 lines
4.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# `make test_isolated`: smoke lab3 и свой набор против одного контейнера
| | |
|---|---|
| Спеки | `student-tests` «Прогон на временной базе» — «Успешный прогон»; «Тесты реплик через балансировщик» — «Против одного процесса»; «Покрытие сценариев основных спеков» — «Сверка покрытия» |
| Change | `replicas-lb`, задача 6.1 (прогон change `instance-id-idempotency` на `af4bca0` — в истории git этого файла) |
| Дата | 2026-10-10 15:12:59 UTC, 65 с |
| Commit | `4e0cc4e` |
| Стенд | образ `mtusi-messenger:lab3` из рабочего дерева на `4e0cc4e`; временная база `test_messenger` в Postgres стенда `mtusi-lab3`, Valkey стенда; отдельный контейнер `mtusi-lab3-test-api` на `127.0.0.1:18088` с лимитами сервиса `api` (1 CPU / 512 MiB); один процесс API без балансировщика, `EXPECT_REPLICAS=1` |
| Рабочий стенд | `make run_docker` запущен (HAProxy на `127.0.0.1:8080`, `api` × 2), во время прогона не трогался: состояние и `StartedAt` всех контейнеров `mtusi-lab3` до и после совпадают |
| Хост | Docker Desktop 29.8.1, macOS arm64; ВМ Docker: 12 CPU, 7,7 GiB RAM; ноутбук от батареи |
## Прогон
```text
$ make test_isolated # exit 0, 65 с
[test_isolated] database=test_messenger container=mtusi-lab3-test-api base_url=http://127.0.0.1:18088
[test_isolated] build image
[test_isolated] create database test_messenger
[test_isolated] migrations
Running upgrade -> 16c279725564, added messenger tables
Running upgrade 16c279725564 -> 42bc3b9be38f, added sessions and password hashes
Running upgrade 42bc3b9be38f -> 7652184b7016, added idempotency keys
[test_isolated] start api container
[test_isolated] ready
[test_isolated] make test
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
[test_isolated] make student_test
BASE_URL=http://127.0.0.1:18088 EXPECT_REPLICAS=1 uv run pytest
collecting ... collected 146 items / 15 deselected / 131 selected
...
coverage: 135 scenarios in 11 specs, 123 tested (16 by make failure_checks), 12 excluded
two series of 18 requests: {'5ce3cbf0541d': 36}
race: 10 clients x 10 messages, statuses {201: 100}, max in flight 10; history: 100 messages, 100 unique ids, 4 pages by 30
username race: 10 clients, statuses {409: 9, 201: 1}, max in flight 10
key race: 10 clients, statuses {201: 10}, max in flight 10; history: 1 messages
SKIPPED [1] student-tests/test_idempotency.py:282: one API process (EXPECT_REPLICAS=1): replica checks need the stand with the load balancer
SKIPPED [1] student-tests/test_load_balancing.py:18: one API process (EXPECT_REPLICAS=1): replica checks need the stand with the load balancer
SKIPPED [1] student-tests/test_load_balancing.py:34: one API process (EXPECT_REPLICAS=1): replica checks need the stand with the load balancer
SKIPPED [1] student-tests/test_race.py:169: one API process (EXPECT_REPLICAS=1): replica checks need the stand with the load balancer
================ 127 passed, 4 skipped, 15 deselected in 55.62s ================
[test_isolated] cleanup
[test_isolated] results: {'test': 0, 'student_test': 0}
```
- Публичный smoke лабы 3 (`tests/smoke.py`, профиль lab3) проходит на
образе этого commit.
- 127 тестов прошли, 4 теста реплик пропущены с причиной «one API
process»: здесь один контейнер без балансировщика. Их прогон через LB
— `student-test-lb.md`.
- «Одно значение на процесс» в режиме одного процесса — одно значение
на все 36 ответов двух серий.
- 15 тестов `fault` собраны, но выполняет их только
`make failure_checks` (`failure-checks.md`).
- Прогон занял 65 с против 21 с до лимитов: контейнер API получает
лимит сервиса `api` (1 CPU), а Argon2id с `p=4` на регистрации и
входе каждого тестового пользователя идёт в одной квоте CPU.