docs: capture lab 6 exclusion evidence, full checks and final report
Coverage-exclusion evidence on the lab 6 stand (db3340d), failure checks, isolated and LB test runs, clean clone and secrets check; fill REPORT.md from the skeleton template, drop PLAN.md (last versiondb3340d). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
# Принявшая реплика остановлена
|
||||
|
||||
- Команда: `python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 attachment-failover --mode stop`, затем то же с `--mode kill` (`make replicas` драйвер выполняет сам в `finally`)
|
||||
- Дата: 2026-11-15, 06:38:59–06:39:10 UTC; оба прогона — код выхода 0
|
||||
- Commit: `db3340d` (ветка `feat/lab6-final`), рабочее дерево без правок кода (изменены только `QUESTIONS.md` и файлы `evidence/`)
|
||||
- Стенд: проект compose `mtusi-lab6`, две реплики за HAProxy, телеметрия включена, собран `make run_docker` из `HEAD`; пользователи синтетические
|
||||
- Сценарий: `attachments` «Принявшая реплика остановлена»
|
||||
- Вывод сокращён: убраны снимки `docker compose ps` до и после (все 15 сервисов `Up`, реплики `healthy`; после прогона `stop` у `api-14` новый `StartedAt` — его вернул `make replicas`)
|
||||
|
||||
## `stop`
|
||||
|
||||
```text
|
||||
mode: stop; fixture sample.png: 111817 bytes
|
||||
sha256 uploaded: 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
|
||||
sha256 downloaded: 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
|
||||
step expected got x-instance-id
|
||||
alice uploads 202 202 e6c96453fc1b
|
||||
attachment is ready ready ready
|
||||
alice sends message 201 201 e6c96453fc1b
|
||||
stop-one.sh stop 0 0 e6c96453fc1b
|
||||
bob downloads 200 200 8112fa687696
|
||||
bob reads metadata 200 200 8112fa687696
|
||||
eve reads metadata 404 404 8112fa687696
|
||||
eve downloads 404 404 8112fa687696
|
||||
make replicas 0 0
|
||||
LB slots UP 2 2
|
||||
PASS: accepted by e6c96453fc1b, served by 8112fa687696 after stop, sha256 matches, outsider gets 404
|
||||
```
|
||||
|
||||
## `kill`
|
||||
|
||||
```text
|
||||
mode: kill; fixture sample.png: 111817 bytes
|
||||
sha256 uploaded: 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
|
||||
sha256 downloaded: 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
|
||||
step expected got x-instance-id
|
||||
alice uploads 202 202 e6c96453fc1b
|
||||
attachment is ready ready ready
|
||||
alice sends message 201 201 e6c96453fc1b
|
||||
stop-one.sh kill 0 0 e6c96453fc1b
|
||||
bob downloads 200 200 8112fa687696
|
||||
bob reads metadata 200 200 8112fa687696
|
||||
eve reads metadata 404 404 8112fa687696
|
||||
eve downloads 404 404 8112fa687696
|
||||
make replicas 0 0
|
||||
LB slots UP 2 2
|
||||
PASS: accepted by e6c96453fc1b, served by 8112fa687696 after kill, sha256 matches, outsider gets 404
|
||||
```
|
||||
@@ -0,0 +1,108 @@
|
||||
# Вложения: метаданные, байты и ограничения обработки
|
||||
|
||||
- Команда: `python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 attachment-storage`
|
||||
- Дата: 2026-11-15, 06:37:43–06:37:47 UTC; код выхода 0
|
||||
- Commit: `db3340d` (ветка `feat/lab6-final`), рабочее дерево без правок кода (изменены только `QUESTIONS.md` и файлы `evidence/`)
|
||||
- Стенд: проект compose `mtusi-lab6`, две реплики за HAProxy, телеметрия включена, собран `make run_docker` из `HEAD`. Контейнеры `docker diff`: реплики `8112fa687696`, `e6c96453fc1b` и worker `2b6afe2410a9`
|
||||
- Сценарии: `attachments` «Байты не в БД и не на диске API», `data-storage` «Ограничения обработки в схеме» (пробы в откатываемой транзакции, запись аудита с неизвестным заданием). В списке колонок есть и колонки контекста W3C задания `traceparent`, `tracestate` (ревизия `e4b8c2d17f90`)
|
||||
- Вывод сокращён: таблица второго вложения повторяет первую и совпала с ожидаемым
|
||||
|
||||
Итог: байты — только объекты приватного bucket (анонимный GET 403), в PostgreSQL — метаданные и SHA-256 (`bytea`, 32 байта), в файловых системах реплик и worker — только смонтированный `config.toml`; четыре пробы ограничений дают названные коды, после отката — одно задание и три варианта.
|
||||
|
||||
```text
|
||||
columns of attachment tables:
|
||||
attachment_job_replays id uuid
|
||||
attachment_job_replays job_id uuid
|
||||
attachment_job_replays operator text
|
||||
attachment_job_replays error_code text
|
||||
attachment_job_replays reason text
|
||||
attachment_job_replays attempt integer
|
||||
attachment_job_replays created_at timestamp with time zone
|
||||
attachment_jobs id uuid
|
||||
attachment_jobs attachment_id uuid
|
||||
attachment_jobs pipeline_version integer
|
||||
attachment_jobs state text
|
||||
attachment_jobs attempt integer
|
||||
attachment_jobs last_error_code text
|
||||
attachment_jobs next_attempt_at timestamp with time zone
|
||||
attachment_jobs lease_expires_at timestamp with time zone
|
||||
attachment_jobs published_at timestamp with time zone
|
||||
attachment_jobs updated_at timestamp with time zone
|
||||
attachment_jobs finished_at timestamp with time zone
|
||||
attachment_jobs created_at timestamp with time zone
|
||||
attachment_jobs attempt_base integer
|
||||
attachment_jobs traceparent text
|
||||
attachment_jobs tracestate text
|
||||
attachment_variants attachment_id uuid
|
||||
attachment_variants pipeline_version integer
|
||||
attachment_variants variant text
|
||||
attachment_variants object_key text
|
||||
attachment_variants content_type text
|
||||
attachment_variants size_bytes integer
|
||||
attachment_variants width integer
|
||||
attachment_variants height integer
|
||||
attachment_variants sha256 bytea
|
||||
attachment_variants created_at timestamp with time zone
|
||||
attachments id uuid
|
||||
attachments chat_id uuid
|
||||
attachments owner_id uuid
|
||||
attachments filename text
|
||||
attachments content_type text
|
||||
attachments size_bytes integer
|
||||
attachments sha256 bytea
|
||||
attachments object_key text
|
||||
attachments status text
|
||||
attachments updated_at timestamp with time zone
|
||||
attachments created_at timestamp with time zone
|
||||
attachments lost_at timestamp with time zone
|
||||
attachments staging_key text
|
||||
attachments error_code text
|
||||
message_attachments message_id uuid
|
||||
message_attachments position smallint
|
||||
message_attachments attachment_id uuid
|
||||
message_attachments created_at timestamp with time zone
|
||||
upload via 8112fa687696: object_key messenger/attachments/178cf6ce-9630-4b2d-85a2-e7b051b328ab/original, staging_key messenger/staging/178cf6ce-9630-4b2d-85a2-e7b051b328ab/original
|
||||
sha256 uploaded 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75, downloaded by a member (200) 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
|
||||
upload via 8112fa687696: object_key messenger/attachments/47cce102-97b2-422d-b519-3a7acecd2d27/original, staging_key messenger/staging/47cce102-97b2-422d-b519-3a7acecd2d27/original
|
||||
sha256 uploaded 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75, downloaded by a member (200) 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
|
||||
constraint probes (rolled back):
|
||||
second job of the version: 23505 uq_attachment_jobs_attachment_id_pipeline_version
|
||||
second variant of the name: 23505 pk_attachment_variants
|
||||
error_code on not failed: 23514 ck_attachments_error_code_failed
|
||||
replay audit of an unknown job: 23503 fk_attachment_job_replays_job_id_attachment_jobs
|
||||
docker diff 8112fa687696: 2 changes
|
||||
C /app
|
||||
A /app/config.toml
|
||||
docker diff e6c96453fc1b: 2 changes
|
||||
C /app
|
||||
A /app/config.toml
|
||||
docker diff 2b6afe2410a9: 2 changes
|
||||
C /app
|
||||
A /app/config.toml
|
||||
bytea columns expected attachment_variants.sha256,attachments.sha256 got attachment_variants.sha256,attachments.sha256
|
||||
octet_length(sha256) expected 32 got 32
|
||||
object_key form expected messenger/attachments/178cf6ce-9630-4b2d-85a2-e7b051b328ab/original got messenger/attachments/178cf6ce-9630-4b2d-85a2-e7b051b328ab/original
|
||||
staging_key: its form or already empty expected yes got yes
|
||||
filename not in key expected no got no
|
||||
variant rows expected crop,optimized,thumbnail got crop,optimized,thumbnail
|
||||
crop in bucket expected yes got yes
|
||||
anonymous GET of crop expected 403 got 403
|
||||
optimized in bucket expected yes got yes
|
||||
anonymous GET of optimized expected 403 got 403
|
||||
thumbnail in bucket expected yes got yes
|
||||
anonymous GET of thumbnail expected 403 got 403
|
||||
object in bucket, bytes expected 111817 got 111817
|
||||
anonymous GET of the key expected 403 got 403
|
||||
downloaded sha256 = uploaded expected yes got yes
|
||||
(второе вложение 47cce102-…: те же 13 строк, expected = got)
|
||||
probe: second job of the version expected 23505 uq_attachment_jobs_attachment_id_pipeline_version got 23505 uq_attachment_jobs_attachment_id_pipeline_version
|
||||
probe: second variant of the name expected 23505 pk_attachment_variants got 23505 pk_attachment_variants
|
||||
probe: error_code on not failed expected 23514 ck_attachments_error_code_failed got 23514 ck_attachments_error_code_failed
|
||||
probe: replay audit of an unknown job expected 23503 fk_attachment_job_replays_job_id_attachment_jobs got 23503 fk_attachment_job_replays_job_id_attachment_jobs
|
||||
jobs | variants after the probes expected 1|3 got 1|3
|
||||
original files in 8112fa687696 expected 0 got 0
|
||||
original files in e6c96453fc1b expected 0 got 0
|
||||
original files in 2b6afe2410a9 expected 0 got 0
|
||||
sha256 of the fixture: 99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75
|
||||
PASS: metadata in PostgreSQL, bytes only in the private bucket messenger, none in the API containers
|
||||
```
|
||||
@@ -0,0 +1,19 @@
|
||||
# Хранение паролей и токенов
|
||||
|
||||
- Команда: `python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 auth-storage`
|
||||
- Дата: 2026-11-15, 06:37:41–06:37:43 UTC; код выхода 0
|
||||
- Commit: `db3340d` (ветка `feat/lab6-final`), рабочее дерево без правок кода (изменены только `QUESTIONS.md` и файлы `evidence/`)
|
||||
- Стенд: проект compose `mtusi-lab6`, две реплики за HAProxy, телеметрия включена, собран `make run_docker` из `HEAD`; пользователи синтетические, пароль и токен только в памяти драйвера, в вывод не попадают
|
||||
- Спеки: `users`, «Хэш в БД», `sessions`, «Токена нет в хранилище» (исключения сверки покрытия: схема и дамп по HTTP не видны)
|
||||
|
||||
Итог: в `users` — строки Argon2id с разной солью у одного пароля, в `sessions` — только SHA-256 токена (32 байта); ни токена (текстом и в hex), ни пароля в `pg_dump --data-only` нет.
|
||||
|
||||
```text
|
||||
users auth_… and auth_…: same password P (36 characters with ':' and Cyrillic)
|
||||
password_hash $argon2id$v=19$m=65536,t=3,p=4$… (97 chars)
|
||||
password_hash $argon2id$v=19$m=65536,t=3,p=4$… (97 chars)
|
||||
hashes differ: t
|
||||
session of the first user: token T (43 characters); rows of sessions with token_hash = SHA-256(T): 1, octet_length 32
|
||||
pg_dump --data-only: 12 COPY blocks; T as text: no, T in hex: no, P as text: no
|
||||
PASS: only Argon2id strings and SHA-256 of the token are stored
|
||||
```
|
||||
@@ -0,0 +1,82 @@
|
||||
# Очереди разных баз разделены
|
||||
|
||||
- Команды по порядку: `make test_isolated KEEP_TEST_DB=1`, `python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 broker-check --require-test-queue`, `make test_isolated`
|
||||
- Дата: 2026-11-15; первый прогон 06:33:58–06:36:07 UTC, `broker-check` 06:40:52–06:41:00 UTC (код 0), второй прогон 06:41:00–06:43:17 UTC. Между первым прогоном и `broker-check` сняты другие доказательства (`evidence/broker/stand.md`, `make test-persistence` с рестартом брокера): очередь временной базы — durable и их пережила
|
||||
- Commit: `db3340d` (ветка `feat/lab6-final`), рабочее дерево без правок кода (изменены только `QUESTIONS.md` и файлы `evidence/`)
|
||||
- Стенд: рабочий `mtusi-lab6`, поверх него — контейнеры `mtusi-lab6-test-api`, `mtusi-lab6-test-worker`, `mtusi-lab6-test-relay` на временной базе `test_messenger` (телеметрия у них выключена)
|
||||
- Сценарий: `message-broker` «Очереди разных баз разделены»
|
||||
- Код 2 обоих `make test_isolated`: smoke — 0, набор — 2 только из-за `test_exclusion_evidence_exists` (в первом — 10 файлов исключений, во втором — только этот файл: его снимает сама эта последовательность). Оба прогона: 1 failed, 217 passed, 6 skipped, 147 deselected, ~117 с. Зелёный прогон после этого файла — `evidence/tests/test-isolated.md`
|
||||
- Список очередей до первого прогона не сохранён: на рабочем стенде перед ним была только `messenger.attachment.process.v1` (прежний `make test_isolated` убирает свою очередь, так и в выводе второго прогона)
|
||||
|
||||
## Очереди брокера: `rabbitmqctl -q list_queues name durable messages consumers --formatter json`
|
||||
|
||||
После `make test_isolated KEEP_TEST_DB=1` — очередь временной базы есть, рабочая не затронута:
|
||||
|
||||
```json
|
||||
[
|
||||
{"messages":0,"name":"test_messenger.attachment.process.v1","consumers":0,"durable":true}
|
||||
,{"messages":0,"name":"messenger.attachment.process.v1","consumers":1,"durable":true}
|
||||
]
|
||||
```
|
||||
|
||||
После второго `make test_isolated` — очереди временной базы нет:
|
||||
|
||||
```json
|
||||
[
|
||||
{"messages":0,"name":"messenger.attachment.process.v1","consumers":1,"durable":true}
|
||||
]
|
||||
```
|
||||
|
||||
## Вывод `make test_isolated`
|
||||
|
||||
Первый прогон (`KEEP_TEST_DB=1`):
|
||||
|
||||
```text
|
||||
[test_isolated] database=test_messenger objects=/buckets/messenger/test_messenger/ queue=test_messenger.attachment.process.v1 containers=mtusi-lab6-test-api mtusi-lab6-test-worker mtusi-lab6-test-relay base_url=http://127.0.0.1:18088
|
||||
[test_isolated] remove objects /buckets/messenger/test_messenger/ and queue test_messenger.attachment.process.v1
|
||||
...
|
||||
[test_isolated] cleanup
|
||||
[test_isolated] kept database test_messenger, objects /buckets/messenger/test_messenger/ and queue test_messenger.attachment.process.v1
|
||||
[test_isolated] results: {'test': 0, 'student_test': 2}
|
||||
```
|
||||
|
||||
Второй прогон:
|
||||
|
||||
```text
|
||||
[test_isolated] database=test_messenger objects=/buckets/messenger/test_messenger/ queue=test_messenger.attachment.process.v1 containers=mtusi-lab6-test-api mtusi-lab6-test-worker mtusi-lab6-test-relay base_url=http://127.0.0.1:18088
|
||||
[test_isolated] remove objects /buckets/messenger/test_messenger/ and queue test_messenger.attachment.process.v1
|
||||
...
|
||||
[test_isolated] cleanup
|
||||
[test_isolated] remove objects /buckets/messenger/test_messenger/ and queue test_messenger.attachment.process.v1
|
||||
[test_isolated] results: {'test': 0, 'student_test': 2}
|
||||
```
|
||||
|
||||
## `broker-check --require-test-queue` между прогонами (код 0)
|
||||
|
||||
```text
|
||||
image rabbitmq:4.3.7@sha256:bd88985187aa73cd598fa0d8b31d49b2f814a6d9e58f6d5a89bae588669d946a
|
||||
memory high watermark 419430400, container limit 536870912
|
||||
queues (name durable messages consumers):
|
||||
test_messenger.attachment.process.v1 True 0 0
|
||||
messenger.attachment.process.v1 True 0 1
|
||||
docker compose stop rabbitmq: 1.2 s
|
||||
image is tag and digest expected yes got yes
|
||||
container health expected healthy got healthy
|
||||
data volume expected mtusi-lab6_rabbitmq_data got mtusi-lab6_rabbitmq_data
|
||||
docker port expected 5672/tcp -> 127.0.0.1:5673 got 5672/tcp -> 127.0.0.1:5673
|
||||
container memory limit expected 536870912 got 536870912
|
||||
watermark below container limit expected yes got yes
|
||||
broker password holders expected rabbitmq,relay,worker got rabbitmq,relay,worker
|
||||
BROKER__* in the api service expected no got no
|
||||
work queue exists expected yes got yes
|
||||
work queue durable expected yes got yes
|
||||
queue test_messenger.attachment.process.v1 expected yes got yes
|
||||
docker compose stop exit code expected 0 got 0
|
||||
container exit code expected 0 got 0
|
||||
stopped before the 20 s grace expected yes got yes
|
||||
broker back (up --wait) expected 0 got 0
|
||||
work queue after restart expected yes got yes
|
||||
worker consumes again expected yes got yes
|
||||
relay survived the outage (StartedAt) expected yes got yes
|
||||
PASS: the broker stand matches the spec
|
||||
```
|
||||
@@ -0,0 +1,36 @@
|
||||
# Брокер рабочего стенда
|
||||
|
||||
- Команда: `python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 broker-check`
|
||||
- Дата: 2026-11-15, 06:37:33–06:37:41 UTC; код выхода 0
|
||||
- Commit: `db3340d` (ветка `feat/lab6-final`), рабочее дерево без правок кода (изменены только `QUESTIONS.md` и файлы `evidence/`)
|
||||
- Стенд: проект compose `mtusi-lab6`, телеметрия включена, собран `make run_docker` из `HEAD`. Очередь `test_messenger.…` в списке — остаток `make test_isolated KEEP_TEST_DB=1` (`evidence/broker/isolated.md`)
|
||||
- Сценарии спека `message-broker`: «Сервис брокера запущен», «Предел памяти брокера», «Остановка брокера»
|
||||
- `watermark` 419430400 байт — 400 МиБ из `infra/rabbitmq/rabbitmq.conf`; лимит контейнера 512 МиБ. Пароль брокера только у `rabbitmq`, `relay`, `worker`: у реплик API настроек брокера нет
|
||||
|
||||
```text
|
||||
image rabbitmq:4.3.7@sha256:bd88985187aa73cd598fa0d8b31d49b2f814a6d9e58f6d5a89bae588669d946a
|
||||
memory high watermark 419430400, container limit 536870912
|
||||
queues (name durable messages consumers):
|
||||
test_messenger.attachment.process.v1 True 0 0
|
||||
messenger.attachment.process.v1 True 0 1
|
||||
temporary database queue test_messenger.attachment.process.v1: not checked
|
||||
docker compose stop rabbitmq: 1.3 s
|
||||
image is tag and digest expected yes got yes
|
||||
container health expected healthy got healthy
|
||||
data volume expected mtusi-lab6_rabbitmq_data got mtusi-lab6_rabbitmq_data
|
||||
docker port expected 5672/tcp -> 127.0.0.1:5673 got 5672/tcp -> 127.0.0.1:5673
|
||||
container memory limit expected 536870912 got 536870912
|
||||
watermark below container limit expected yes got yes
|
||||
broker password holders expected rabbitmq,relay,worker got rabbitmq,relay,worker
|
||||
BROKER__* in the api service expected no got no
|
||||
work queue exists expected yes got yes
|
||||
work queue durable expected yes got yes
|
||||
docker compose stop exit code expected 0 got 0
|
||||
container exit code expected 0 got 0
|
||||
stopped before the 20 s grace expected yes got yes
|
||||
broker back (up --wait) expected 0 got 0
|
||||
work queue after restart expected yes got yes
|
||||
worker consumes again expected yes got yes
|
||||
relay survived the outage (StartedAt) expected yes got yes
|
||||
PASS: the broker stand matches the spec
|
||||
```
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
# Кэш карточки чата
|
||||
|
||||
- Команды: `make test_isolated KEEP_TEST_DB=1` (ключи временной базы), затем `python3 .claude/skills/run-mtusi-messenger/driver.py --port 8080 cache-check --require-test-keys`
|
||||
- Дата: 2026-11-15; `make test_isolated` до 06:36:07 UTC, `cache-check` 06:36:37–06:37:02 UTC, код выхода `cache-check` 0
|
||||
- Код выхода `make test_isolated` 2 и только по одной причине: `test_exclusion_evidence_exists` (этого файла и соседних исключений ещё не было); публичный `make test` в нём — код 0. Снятие файла этой команды требует её прогона, поэтому поменять порядок нельзя
|
||||
- Commit: `db3340d` (ветка `feat/lab6-final`), рабочее дерево без правок кода (изменены только `QUESTIONS.md` и файлы `evidence/`)
|
||||
- Стенд: проект compose `mtusi-lab6`, две реплики за HAProxy, телеметрия включена, собран `make run_docker` из `HEAD`; пользователи и чат синтетические
|
||||
- Спеки: `chat-cache`, «Чтение из кэша», «Срок записи», «Временная база» (исключения сверки покрытия: по HTTP ответ из кэша не отличить от ответа из PostgreSQL)
|
||||
|
||||
Итог: на 50 чтений карточки через LB — одно чтение таблицы `chats` (первое, ключ перед этим удалён), +49 попаданий и +1 промах Valkey; срок ключа не больше настроенного (3600 с), чтения его не продлевают; ключи рабочей и временной базы — под разными префиксами (1 и 166).
|
||||
|
||||
```text
|
||||
users alice_… (creator) and bob_… (reader), chat a0334358-bf18-4591-a565-056c4e4ef3e3
|
||||
key messenger:v1:messenger:chat:a0334358-bf18-4591-a565-056c4e4ef3e3
|
||||
right after 201: EXISTS 1, TTL 3600 s (configured [cache] chat_ttl_seconds 3600 s in the replica); value keys ['created_at', 'id', 'member_ids', 'title'], member_ids in creation order: yes
|
||||
DEL key: the first read is a miss; waiting 11 s
|
||||
50 × GET /api/v1/chats/{id} by the reader through LB: 50 equal to the creation response; by replica 8112fa687696 25, e6c96453fc1b 25
|
||||
after 11 s: reads of table chats (seq_scan + idx_scan) +1, keyspace_hits +49, keyspace_misses +1
|
||||
TTL 3589 s, then 10 more reads, TTL 3588 s: reads do not extend the key
|
||||
keys messenger:v1:messenger:chat:*: 1
|
||||
keys messenger:v1:test_messenger:chat:*: 166
|
||||
PASS: one read of chats, the rest from Valkey; TTL is bounded; temporary database: 166 keys under its own prefix
|
||||
```
|
||||
@@ -0,0 +1,34 @@
|
||||
# Отказ одной реплики API
|
||||
|
||||
- Команды: `make test-failover ACTION_SCRIPT=scripts/stop-one.sh STOP_MODE=stop STOP_ONE_LOG=<файл>`, `make replicas`, `make test-failover ACTION_SCRIPT=scripts/stop-one.sh STOP_MODE=kill STOP_ONE_LOG=<файл>`, `make replicas`, `make lb_stats`
|
||||
- Дата: 2026-11-15, 06:49:05–06:49:41 UTC; оба прогона — код выхода 0
|
||||
- Commit: `db3340d` (ветка `feat/lab6-final`), рабочее дерево без правок кода (изменены только `QUESTIONS.md` и файлы `evidence/`)
|
||||
- Стенд: проект compose `mtusi-lab6`, две реплики за HAProxy, телеметрия включена, собран `make run_docker` из `HEAD`
|
||||
- `STOP_ONE_LOG` назвал реплику: в обоих прогонах `TARGET_INSTANCE_ID=d34fc9b86aa4`, контейнер `d34fc9b86aa4…`, остановленный контейнер совпадает с целью; между прогонами `make replicas` вернул реплику
|
||||
- `failed_attempts` 1 в режиме `kill` — запись, которая была в полёте на убитой реплике: LB не повторяет `POST` после отправленного запроса (повтор — только на отказ соединения, `balancer.md`), клиент проверки повторяет её сам с тем же ключом и телом, дубля нет; данные и сессия сохранены (`PASS`). В лабе 5 на той же проверке было 0 — гонка момента `docker kill` с отправкой записи, а не изменение кода. 5xx на `BACKEND` в статистике — накопленные с рестарта LB, в том числе от `attachment-failover`
|
||||
|
||||
## `stop`
|
||||
|
||||
```text
|
||||
{"observed_instances_before": 2, "successful_writes": 120, "failed_attempts": 0, "first_recovery_seconds": 1.201}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
2026-11-15T06:49:06Z TARGET_INSTANCE_ID=d34fc9b86aa4 container=d34fc9b86aa4edfc55f531909a22818375ef6466c58d818b86de046e702d7cdb mode=stop
|
||||
```
|
||||
|
||||
## `kill`
|
||||
|
||||
```text
|
||||
{"observed_instances_before": 2, "successful_writes": 114, "failed_attempts": 1, "first_recovery_seconds": 0.231}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
2026-11-15T06:49:24Z TARGET_INSTANCE_ID=d34fc9b86aa4 container=d34fc9b86aa4edfc55f531909a22818375ef6466c58d818b86de046e702d7cdb mode=kill
|
||||
```
|
||||
|
||||
## После `make replicas`
|
||||
|
||||
```text
|
||||
svname addr status check_status scur stot econ wretr wredis hrsp_5xx
|
||||
api-1 192.168.96.9:8080 UP L7OK 0 1152 0 0 6 0
|
||||
api-2 192.168.96.8:8080 UP L7OK 0 1379 0 0 0 0
|
||||
BACKEND - UP - 0 2527 2 0 6 3
|
||||
free slots: 6
|
||||
```
|
||||
@@ -0,0 +1,76 @@
|
||||
# Повтор отправки после рестарта API
|
||||
|
||||
- Шаги: синтетический пользователь (регистрация, вход по Basic) и чат; `POST /api/v1/chats/<chat>/messages` с `Idempotency-Key`; `docker compose up -d --force-recreate api`; ожидание `/health/ready` 200 через LB; тот же `POST` с тем же ключом и токеном; другое тело с тем же ключом; `GET` истории. Шаги выполнил разовый скрипт на stdlib вне репозитория (те же запросы, что `driver.py --port 8080 req … --key <ключ>` скилла), шаги выше повторяются руками
|
||||
- Дата: 2026-11-15, 06:39:32–06:39:38 UTC; код выхода 0
|
||||
- Commit: `db3340d` (ветка `feat/lab6-final`), рабочее дерево без правок кода (изменены только `QUESTIONS.md` и файлы `evidence/`)
|
||||
- Стенд: проект compose `mtusi-lab6`, две реплики за HAProxy, телеметрия включена, собран `make run_docker` из `HEAD`; пользователь и чат синтетические
|
||||
- Спек: `idempotency`, «Повтор после рестарта API» (исключение сверки покрытия: тесты сервер не трогают)
|
||||
- Вывод обезличен: ключ заменён на `<key>`; токена и пароля в выводе нет
|
||||
|
||||
Итог: новые контейнеры обеих реплик (другие `id` и `StartedAt`), повтор — тот же 201 и тот же `Message` от реплики, которой при первой отправке не было (`e6c96453fc1b` → `d34fc9b86aa4`). В истории одно сообщение; другое тело с тем же ключом — 409. Сессия и ключ лежат в PostgreSQL, поэтому пересоздание реплик на них не влияет. Compose пересоздал только реплики, зависимости (`migrate`, `s3-bootstrap`) лишь повторно запустил; PostgreSQL не перезапускался.
|
||||
|
||||
```text
|
||||
--- before: api containers (name, id, StartedAt)
|
||||
/mtusi-lab6-api-13 8112fa687696 2026-11-15T06:33:44.100363013Z
|
||||
/mtusi-lab6-api-14 e6c96453fc1b 2026-11-15T06:39:07.790523426Z
|
||||
--- first send
|
||||
idempotency-key: <key>
|
||||
201 x-request-id: 2186a97e48604705a47121996a371299 x-instance-id: e6c96453fc1b
|
||||
{
|
||||
"id": "a23371cd-c05f-4d9c-b5a5-5fad6612ae9d",
|
||||
"chat_id": "9a476e8c-87fe-4ea8-985b-24880bd533b3",
|
||||
"sender_id": "c964e2db-d181-4e27-8d42-4d72e68fe2a4",
|
||||
"text": "replay after restart",
|
||||
"created_at": "2026-11-15T06:39:32.610039Z",
|
||||
"attachment_ids": []
|
||||
}
|
||||
--- docker compose up -d --force-recreate api
|
||||
Container mtusi-lab6-api-13 Recreate
|
||||
Container mtusi-lab6-api-14 Recreate
|
||||
Container mtusi-lab6-api-13 Recreated
|
||||
Container mtusi-lab6-api-14 Recreated
|
||||
Container mtusi-lab6-s3-bootstrap-1 Starting
|
||||
Container mtusi-lab6-migrate-1 Starting
|
||||
Container mtusi-lab6-s3-bootstrap-1 Started
|
||||
Container mtusi-lab6-migrate-1 Started
|
||||
Container mtusi-lab6-migrate-1 Waiting
|
||||
Container mtusi-lab6-s3-bootstrap-1 Waiting
|
||||
Container mtusi-lab6-migrate-1 Exited
|
||||
Container mtusi-lab6-s3-bootstrap-1 Exited
|
||||
Container mtusi-lab6-api-14 Starting
|
||||
Container mtusi-lab6-api-14 Started
|
||||
Container mtusi-lab6-api-13 Starting
|
||||
Container mtusi-lab6-api-13 Started
|
||||
exit 0
|
||||
LB ready: 200
|
||||
--- after: api containers (name, id, StartedAt)
|
||||
/mtusi-lab6-api-13 d34fc9b86aa4 2026-11-15T06:39:37.107929926Z
|
||||
/mtusi-lab6-api-14 35f606496f73 2026-11-15T06:39:37.041578759Z
|
||||
--- repeat with the same key, the same session
|
||||
idempotency-key: <key>
|
||||
201 x-request-id: ecdfd487a0de46f7b6f97665adf584d2 x-instance-id: d34fc9b86aa4
|
||||
{
|
||||
"id": "a23371cd-c05f-4d9c-b5a5-5fad6612ae9d",
|
||||
"chat_id": "9a476e8c-87fe-4ea8-985b-24880bd533b3",
|
||||
"sender_id": "c964e2db-d181-4e27-8d42-4d72e68fe2a4",
|
||||
"text": "replay after restart",
|
||||
"created_at": "2026-11-15T06:39:32.610039Z",
|
||||
"attachment_ids": []
|
||||
}
|
||||
--- other body with the same key
|
||||
idempotency-key: <key>
|
||||
409 x-request-id: 12ed1beb0aa5443a9181b2869e62336f x-instance-id: 35f606496f73
|
||||
{
|
||||
"error": {
|
||||
"code": "conflict",
|
||||
"message": "Idempotency key was already used with another request",
|
||||
"request_id": "12ed1beb0aa5443a9181b2869e62336f"
|
||||
}
|
||||
}
|
||||
--- history
|
||||
{"count": 1, "ids": ["a23371cd-c05f-4d9c-b5a5-5fad6612ae9d"]}
|
||||
--- compare
|
||||
Message of the repeat = Message of the first send: yes
|
||||
other instance answered the repeat: yes
|
||||
PASS
|
||||
```
|
||||
@@ -0,0 +1,34 @@
|
||||
# Сохранность при рестарте стенда
|
||||
|
||||
- Команда: `make test-persistence ACTION_SCRIPT=scripts/restart.sh`
|
||||
- Дата: 2026-11-15, 06:40:04–06:40:30 UTC; код выхода 0
|
||||
- Commit: `db3340d` (ветка `feat/lab6-final`), рабочее дерево без правок кода (изменены только `QUESTIONS.md` и файлы `evidence/`)
|
||||
- Стенд: проект compose `mtusi-lab6`, телеметрия включена, собран `make run_docker` из `HEAD`
|
||||
- Что проверяет публичная проверка: данные, прежний токен и с лабы 4 оригинал вложения после hook (`tests/README.md`)
|
||||
- Что перезапустил hook (сверка `docker inspect` до и после, `RestartCount` у всех 0): `api-13`, `api-14`, `haproxy`, `postgres`, `rabbitmq`, `s3`, `valkey` — новый `StartedAt`; `relay`, `worker` и `cleaner` hook не трогает, `StartedAt` прежний. Сервисы телеметрии (`otel-collector`, `prometheus`, `loki`, `tempo`, `grafana`) hook тоже не трогает — `StartedAt` прежний (вопрос 2 `## otel-telemetry` в `QUESTIONS.md`, предложение S2 там же). Одноразовые `migrate` и `s3-bootstrap` повторяет `start api` (no-op). Volumes не удалялись
|
||||
|
||||
```text
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
```
|
||||
|
||||
| Контейнер | `StartedAt` до | `StartedAt` после |
|
||||
|---|---|---|
|
||||
| `api-13` | 06:39:37.107 | 06:40:28.849 |
|
||||
| `api-14` | 06:39:37.041 | 06:40:28.785 |
|
||||
| `haproxy-1` | 06:33:44.415 | 06:40:28.929 |
|
||||
| `postgres-1` | 06:33:36.616 | 06:40:05.823 |
|
||||
| `rabbitmq-1` | 06:37:36.623 | 06:40:06.835 |
|
||||
| `s3-1` | 06:33:36.481 | 06:40:20.757 |
|
||||
| `valkey-1` | 06:33:37.067 | 06:40:05.845 |
|
||||
| `migrate-1` | 06:39:33.975 | 06:40:25.653 |
|
||||
| `s3-bootstrap-1` | 06:39:33.914 | 06:40:25.731 |
|
||||
| `relay-1` | 06:33:40.789 | 06:33:40.789 |
|
||||
| `worker-1` | 06:33:44.241 | 06:33:44.241 |
|
||||
| `cleaner-1` | 06:33:44.322 | 06:33:44.322 |
|
||||
| `otel-collector-1` | 06:33:36.959 | 06:33:36.959 |
|
||||
| `prometheus-1` | 06:33:37.162 | 06:33:37.162 |
|
||||
| `loki-1` | 06:33:36.545 | 06:33:36.545 |
|
||||
| `tempo-1` | 06:33:36.794 | 06:33:36.794 |
|
||||
| `grafana-1` | 06:33:36.867 | 06:33:36.867 |
|
||||
|
||||
`rabbitmq-1` до прогона — 06:37:36: его остановил и вернул `driver.py broker-check` (`evidence/broker/stand.md`); `api-13` и `api-14` — 06:39:37: их пересоздал повтор отправки (`evidence/idempotency/replay-after-restart.md`).
|
||||
@@ -0,0 +1,62 @@
|
||||
# Проверка из чистого clone: стенд с телеметрией одной командой
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Что проверялось | раздел `REPORT.md` «Запуск из чистого clone»: шаг за шагом, как у проверяющего, на пустых volumes |
|
||||
| Дата | 2026-11-15, 07:28:57–07:32:42 UTC |
|
||||
| Commit | `db3340d` — `git clone --branch feat/lab6-final` локального репозитория во временный каталог. Рабочее дерево клона чистое, `.env`, `config.toml` и `.venv` нет. Код тот же, что в `solution/bvt2301-safronov` после влития ветки: после `db3340d` меняются только документы и `evidence/` |
|
||||
| Стенд | временный проект compose `mtusi-lab6-clonecheck` на нестандартных портах: LB `127.0.0.1:8090`, Grafana 3010, PostgreSQL 5443, Valkey 6390, S3 8344, AMQP 5683. Рабочий стенд `mtusi-lab6` всё это время работал рядом и не трогался. После проверки стенд клона удалён (`docker compose down`, затем `docker volume rm` шести volumes `mtusi-lab6-clonecheck_*` по имени), каталог клона удалён; volumes `mtusi-lab6_*` на месте |
|
||||
| Хост | Docker Desktop 29.9.2, Compose 5.6.1, macOS на Apple M3 Pro; ВМ Docker — 12 CPU, 11 902 МиБ. Это проверка, а не замер |
|
||||
|
||||
**Отличие от последовательности проверяющего — строки `.env`.** Порты по умолчанию и имя проекта занимает рабочий стенд,
|
||||
поэтому до `make env_setup` в клон записан `.env` из восьми строк: `COMPOSE_PROJECT_NAME=mtusi-lab6-clonecheck` и порты
|
||||
`APP_OUT_PORT`, `POSTGRES_OUT_PORT`, `VALKEY_OUT_PORT`, `S3_OUT_PORT`, `RABBITMQ_OUT_PORT`, `GRAFANA_OUT_PORT`, `TEST_APP_PORT`.
|
||||
Остальные переменные, в том числе все секреты, дописал `make env_setup` из `.env.example` (путь проверяющего со старым `.env`).
|
||||
Цели `Makefile`, `scripts/restart.sh` и `scripts/stop-one.sh` берут проект и порты у `docker compose` и из `.env`; отличие
|
||||
одно — `BASE_URL=http://localhost:8090` у `make test`, `make student_test`, `make test-persistence`, `make test-failover`.
|
||||
|
||||
Значения секретов не выводились: поиск 13 значений секретов из `.env` клона по журналам проверки — 0 совпадений.
|
||||
|
||||
## Шаги
|
||||
|
||||
| Шаг | Код | Время | Результат |
|
||||
| --- | --- | --- | --- |
|
||||
| `make env_setup` | 0 | <1 с | «added to existing .env: …» — 43 имени, в том числе `S3_WORKER_*`, `RABBITMQ_DEFAULT_PASS`, `GRAFANA_ADMIN_PASSWORD`; `POSTGRES_PASSWORD` и `VALKEY_PASSWORD` — 32 символа; `docker compose config` → `name: mtusi-lab6-clonecheck` |
|
||||
| `make run_docker` | 0 | 13,8 с (слои — из кэша BuildKit) | пустые volumes `postgres_data`, `s3_data`, `rabbitmq_data`, `prometheus_data`, `loki_data`, `tempo_data` созданы, `migrate` и `s3-bootstrap` — `Exited (0)` |
|
||||
| `make replicas` | 0 | ~2 с | обе реплики `healthy` |
|
||||
| `make check` | 0 | 1 с | `PASS: offline skeleton structure, local refs and Python syntax` |
|
||||
| `make test BASE_URL=http://localhost:8090` | 0 | 1 с | `PASS: lab6 public API scenario` |
|
||||
| `make student_test BASE_URL=http://localhost:8090` | 2 | 81 с | 223 passed, **1 failed — `test_exclusion_evidence_exists`**: в `db3340d` ещё нет 8 файлов исключений, снятых последним шагом в рабочем дереве (их коммит — следующий). Остальной набор, включая тесты реплик, зелёный; на рабочем стенде с этими файлами — 224 passed (`evidence/tests/student-test-lb.md`), в CI — после push |
|
||||
| `make test-persistence ACTION_SCRIPT=scripts/restart.sh BASE_URL=…` | 0 | 26 с | `PASS: persistence preserved confirmed data and existing session` |
|
||||
| `make test-failover ACTION_SCRIPT=scripts/stop-one.sh BASE_URL=…` | 0 | 17 с | `failed_attempts` 0, `first_recovery_seconds` 0,519 |
|
||||
| `make replicas` | 0 | 2 с | реплика возвращена |
|
||||
| `make alerts_test` | 0 | 1 с | 7 оповещений, у каждого runbook |
|
||||
| Grafana API (`admin` и пароль из `.env` клона) | — | — | источники `loki`, `prometheus`, `tempo`; dashboard `messenger-overview` «Messenger overview» в папке Messenger; без учётных данных — 401 |
|
||||
| `RestartCount` брокера и сервисов телеметрии | — | — | 0 у `rabbitmq`, `otel-collector`, `prometheus`, `loki`, `tempo`, `grafana`; `eacces` в журнале брокера — 0 строк |
|
||||
|
||||
## Стенд клона
|
||||
|
||||
```text
|
||||
NAME STATUS PORTS
|
||||
mtusi-lab6-clonecheck-api-1 Up 11 seconds (healthy) 8080/tcp
|
||||
mtusi-lab6-clonecheck-api-2 Up 11 seconds (healthy) 8080/tcp
|
||||
mtusi-lab6-clonecheck-cleaner-1 Up 11 seconds 8080/tcp
|
||||
mtusi-lab6-clonecheck-grafana-1 Up 21 seconds (healthy) 127.0.0.1:3010->3000/tcp
|
||||
mtusi-lab6-clonecheck-haproxy-1 Up 11 seconds (healthy) 127.0.0.1:8090->8080/tcp
|
||||
mtusi-lab6-clonecheck-loki-1 Up 21 seconds 3100/tcp
|
||||
mtusi-lab6-clonecheck-migrate-1 Exited (0) 17 seconds ago
|
||||
mtusi-lab6-clonecheck-otel-collector-1 Up 20 seconds 4317-4318/tcp, 55679/tcp
|
||||
mtusi-lab6-clonecheck-postgres-1 Up 21 seconds (healthy) 127.0.0.1:5443->5432/tcp
|
||||
mtusi-lab6-clonecheck-prometheus-1 Up 21 seconds (healthy) 9090/tcp
|
||||
mtusi-lab6-clonecheck-rabbitmq-1 Up 21 seconds (healthy) 127.0.0.1:5683->5672/tcp
|
||||
mtusi-lab6-clonecheck-relay-1 Up 16 seconds 8080/tcp
|
||||
mtusi-lab6-clonecheck-s3-1 Up 21 seconds (healthy) 127.0.0.1:8344->8333/tcp
|
||||
mtusi-lab6-clonecheck-s3-bootstrap-1 Exited (0) 12 seconds ago
|
||||
mtusi-lab6-clonecheck-tempo-1 Up 20 seconds
|
||||
mtusi-lab6-clonecheck-valkey-1 Up 21 seconds (healthy) 127.0.0.1:6390->6379/tcp
|
||||
mtusi-lab6-clonecheck-worker-1 Up 11 seconds 8080/tcp
|
||||
```
|
||||
|
||||
Наружу опубликованы только LB, Grafana и служебные порты хранилищ на `127.0.0.1`; порты Collector, Prometheus, Loki и Tempo
|
||||
видны только в сетях стенда (`4317-4318/tcp` без адреса хоста). После уборки контейнеров, volumes и сетей проекта
|
||||
`mtusi-lab6-clonecheck` — 0.
|
||||
@@ -0,0 +1,70 @@
|
||||
# Проверки отказов
|
||||
|
||||
- Команда: `make failure_checks`
|
||||
- Дата: 2026-11-15, 06:50:18–07:28:09 UTC; код выхода 0
|
||||
- Commit: `db3340d` (ветка `feat/lab6-final`), рабочее дерево без правок кода (во время прогона менялись только `REPORT.md`, `AGENTS.md`, `QUESTIONS.md` и файлы `evidence/`; образ стенд собрал в начале)
|
||||
- Стенд: проект `mtusi-lab6-failures` со своими PostgreSQL, Valkey, S3, RabbitMQ, уборщиком, relay, worker и пятью API (телеметрия у API, worker и relay выключена, сервисы телеметрии не запускаются); рабочий стенд `mtusi-lab6` на время прогона работал рядом (в первые минуты — `make service_test`, `make service_test_db` и офлайн-проверки); стенд отказов и его volumes удалены в конце
|
||||
- Итог: **147 passed, 224 deselected, pytest 2242,88 с (37:22)**; журнал PostgreSQL стенда без признаков аварии (`crash markers 0`). «too many clients» 34 и «administrator command» 194 — следы самих проверок (заполнение слотов, остановки PostgreSQL). Набор тот же, что в лабе 5 (147 проверок): лаба 6 проверок отказов не добавляла — телеметрию проверяют быстрые тесты и команды драйвера
|
||||
- Параметры: уборщик — grace 20 с, интервал 1 с, плановая сверка выключена; worker — 4 попытки, пауза 4–16 с, срок 10 с, запас аренды 2 с, рендер 8 с / 3 с CPU, graceful 2 с; relay — опрос 0,2 с, повторная публикация через 5 с
|
||||
- Вывод сокращён: убраны лог сборки и шаги compose, адреса API временные, строки `PASSED` свёрнуты в список имён. Таблицы красных прогонов (временные регрессии) — в отчётах лаб 4 и 5 и в `tasks.md` их change: код этих веток в лабе 6 не менялся
|
||||
|
||||
```text
|
||||
[failure_checks] project=mtusi-lab6-failures (working stand: mtusi-lab6)
|
||||
[failure_checks] build image
|
||||
[failure_checks] start postgres, valkey, s3 and rabbitmq
|
||||
[failure_checks] migrations
|
||||
[failure_checks] s3 bootstrap
|
||||
[failure_checks] start cleaner: grace 20 s, interval 1 s, reconcile interval 0 s (0 — off)
|
||||
[failure_checks] start worker: attempts 4, retry 4–16 s, job timeout 10 s, lease margin 2 s, render 8 s / 3 s CPU, graceful 2 s
|
||||
[failure_checks] start relay: poll 0.2 s, republish after 5 s
|
||||
[failure_checks] start api containers
|
||||
[failure_checks] ready: api=http://127.0.0.1:50598 tight=http://127.0.0.1:50603 uploads=http://127.0.0.1:50611 s3=http://127.0.0.1:50620 backlog=http://127.0.0.1:50627
|
||||
[failure_checks] pytest -m fault
|
||||
collecting ... collected 371 items / 224 deselected / 147 selected
|
||||
=============== 147 passed, 224 deselected in 2242.88s (0:37:22) ===============
|
||||
[failure_checks] postgres log: 572 lines, crash markers 0; "too many clients" 34, "administrator command" 194
|
||||
[failure_checks] cleanup
|
||||
[failure_checks] results: {'fault': 0, 'postgres': 0}
|
||||
```
|
||||
|
||||
## Прошедшие проверки по порядку
|
||||
|
||||
```text
|
||||
test_expired_token test_use_does_not_extend_session test_token_while_database_stopped test_members_failure_rolls_back_chat
|
||||
test_database_stopped_and_back test_pool_exhausted test_connection_limit_reached test_pool_keeps_connections
|
||||
test_readiness_without_database test_readiness_without_cache test_readiness_without_object_storage[stop] test_readiness_without_object_storage[pause]
|
||||
test_flush_cache test_valkey_stopped test_valkey_paused test_valkey_back
|
||||
test_message_failure_keeps_key_free test_database_outage_keeps_key_free test_key_free_after_ttl test_upload_with_object_storage_stopped
|
||||
test_rejected_uploads_leave_nothing test_metadata_insert_failure test_interrupted_body test_queued_failure_compensated
|
||||
test_killed_between_put_and_ready test_queued_commit_outcome_unknown test_upload_outlives_grace test_cleaner_failure_after_object_delete
|
||||
test_cleaner_survives_outages test_object_storage_stopped test_environment_does_not_change_limits test_object_storage_paused
|
||||
test_upload_slots_busy test_rejections_before_queue test_upload_waits_for_slot test_slot_released_after_failures
|
||||
test_slow_body test_upload_after_idle_s3 test_queued_while_worker_stopped test_processing_visible
|
||||
test_redelivery_of_ready_is_noop test_durable_state_at_202 test_transient_error_retried test_job_message_matches_schema
|
||||
test_queue_durable test_malformed_message_dropped test_unknown_job_acked test_worker_killed_during_processing
|
||||
test_duplicate_during_processing test_original_published_unchanged test_staging_corrupted test_staging_missing
|
||||
test_max_pixels_fit_worker_memory test_ready_failure_retried test_queued_between_attempts test_attempts_exhausted
|
||||
test_database_outage_during_processing test_undecodable_becomes_failed test_worker_down_api_serves test_concurrency_bounded
|
||||
test_api_killed_after_202 test_broker_restart_keeps_job test_broker_kill_keeps_confirmed test_defense_scenario
|
||||
test_upload_with_broker_stopped test_upload_with_broker_paused test_queue_deleted test_broker_recreated
|
||||
test_start_without_broker test_worker_survives_broker_restart test_content_before_ready test_message_with_queued_attachment
|
||||
test_attachment_failed_after_message test_replay_after_attachment_failed test_readiness_without_broker_and_worker[stop] test_readiness_without_broker_and_worker[pause]
|
||||
test_worker_stop_during_processing test_worker_stop_during_render test_cleaner_keeps_current_work test_reconcile_finds_and_fixes
|
||||
test_reconcile_keeps_fresh_used_and_unknown test_reconcile_restored_original test_reconcile_change_limit test_reconcile_keeps_referenced_objects
|
||||
test_reconcile_limit_keeps_cleanup test_reconcile_foreign_key_untouched test_reconcile_object_storage_stopped test_reconcile_interrupted_by_database
|
||||
test_reconcile_under_load test_scheduled_reconcile test_reconcile_head_strategy_same_findings test_reconcile_deep_checksum
|
||||
test_reconcile_restore_needs_same_bytes test_reconcile_rate_limit test_reconcile_limit_stops_rechecks test_reconcile_row_with_other_id_key
|
||||
test_reconcile_fresh_overwrite_untouched test_reconcile_variant_objects test_reconcile_orphan_variant test_reconcile_keeps_current_work
|
||||
test_relay_killed_before_publish test_relay_killed_after_confirm test_relay_survives_broker_outage test_relay_survives_database_outage
|
||||
test_two_relays test_relay_respects_next_attempt test_lost_message_republished test_no_copies_while_queue_has_messages
|
||||
test_published_backlog_limit test_broker_memory_alarm test_crash_after_objects_before_commit test_crash_after_commit_before_ack
|
||||
test_retry_backoff_with_jitter test_retry_waits_outside_worker test_limit_pixels test_limit_oversized_staging
|
||||
test_limit_cpu_scan_bomb test_limit_memory test_limit_render_timeout test_render_killed
|
||||
test_hung_worker_lease_fencing test_hung_worker_thawed_after_ready test_long_attempt_keeps_lease test_last_attempt_lost
|
||||
test_replay_registry_dry_run test_replay_returns_work test_replay_ready_refused test_replay_in_progress_refused
|
||||
test_replay_without_source_refused test_replay_new_budget test_replay_by_code test_prefetch_bounded
|
||||
test_missing_variant test_cancelled_upload_of_previous_version test_staging_removed_after_ready test_staging_retention
|
||||
test_staging_keeps_current_work test_staging_cleanup_survives_outage test_staging_foreign_key_kept test_reconcile_orphan_staging
|
||||
test_defense_faults test_backlog_limit test_backlog_ignores_finished test_backlog_counts_waiting_retry
|
||||
test_backlog_without_broker test_backlog_overshoot_bounded test_backlog_off
|
||||
```
|
||||
@@ -0,0 +1,45 @@
|
||||
# Офлайн-проверки последнего шага
|
||||
|
||||
- Команды: `make alerts_test`, `make check`, `make validate PYTHON=.venv/bin/python`, `make lint`
|
||||
- Дата: 2026-11-15, 06:51:11–06:51:14 UTC; все четыре — код выхода 0
|
||||
- Commit: `db3340d` (ветка `feat/lab6-final`), рабочее дерево без правок кода (изменены только `QUESTIONS.md` и файлы `evidence/`); `make lint` файлов не изменил (619 без изменений, `git status` до и после тот же)
|
||||
- Без стенда: `make alerts_test` — одноразовый контейнер образа Prometheus из compose с `--network none`. Разбор правил и контроли красного прогона — `evidence/alerts/rules-test.md` (`ef60b47`), правила с тех пор не менялись
|
||||
|
||||
```text
|
||||
$ make alerts_test
|
||||
promtool from prom/prometheus:v3.15.1@sha256:fa3302279710be2f21a8301ec17a8b4f2301fd829bd113839b3b6b02b6f191a2
|
||||
Checking prometheus.yml
|
||||
SUCCESS: 1 rule files found
|
||||
SUCCESS: prometheus.yml is valid prometheus config file syntax
|
||||
Checking /etc/prometheus/rules.yml
|
||||
SUCCESS: 20 rules found
|
||||
Checking rules.yml
|
||||
SUCCESS: 20 rules found
|
||||
SUCCESS
|
||||
runbook infra/otel/runbooks/MessengerHighErrorRate.md: ok
|
||||
runbook infra/otel/runbooks/MessengerSlowRequests.md: ok
|
||||
runbook infra/otel/runbooks/MessengerNoReadyReplicas.md: ok
|
||||
runbook infra/otel/runbooks/MessengerQueueLagHigh.md: ok
|
||||
runbook infra/otel/runbooks/MessengerQueueMetricsMissing.md: ok
|
||||
runbook infra/otel/runbooks/TelemetryTargetDown.md: ok
|
||||
runbook infra/otel/runbooks/TelemetryDataLoss.md: ok
|
||||
alerts: 7, each with an existing runbook
|
||||
|
||||
$ make check
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
|
||||
$ make validate PYTHON=.venv/bin/python
|
||||
.venv/bin/python scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
|
||||
$ make lint
|
||||
619 files left unchanged
|
||||
code formatted
|
||||
All checks passed!
|
||||
code checked and fixed if needed
|
||||
619 files left unchanged
|
||||
code formatted
|
||||
All checks passed!
|
||||
code checked and fixed if needed
|
||||
```
|
||||
@@ -0,0 +1,15 @@
|
||||
# Секретов в `evidence/` и отчёте нет
|
||||
|
||||
- Что сделано: разовый скрипт (вне репозитория) читает `.env` рабочего стенда, берёт значения переменных с `PASS`, `SECRET`, `KEY`, `TOKEN` в имени (не короче 8 символов, без ссылок-шаблонов `${…}`) и ищет их байтами во всех файлах `evidence/`, включая `raw/` (быстрые метки `quick-*` и `.work/` в git не идут и в счёт не входят). Значения не печатаются, только имена и пути. Он же ищет абсолютный путь домашнего каталога и строки `Authorization: Bearer|Basic <значение>`. Второй проход — все файлы, отслеживаемые git, и `REPORT.md`. Третий — история всех веток на `.env` и `config.toml`
|
||||
- Дата: 2026-11-15, 07:33 UTC; код выхода 0
|
||||
- Commit: `db3340d` (ветка `feat/lab6-final`) плюс рабочее дерево последнего шага: новые файлы `evidence/` (исключения, проверки, чистый clone), `REPORT.md`, `AGENTS.md`, `QUESTIONS.md`
|
||||
- `authorization with credentials: 1` в `tracked` — `examples/requests.http` skeleton: заглушки `REPLACE_WITH_LOCAL_BASE64_CREDENTIAL` и `{{sessionToken}}`, значений нет
|
||||
- Секреты клона из `evidence/tests/clean-clone.md` (свой `.env`, удалён с клоном) проверены тем же способом по журналам проверки — 13 значений, 0 совпадений
|
||||
- Тестовые токены и пароли синтетические и в выводы не попадают: драйвер печатает `token T (43 characters)`, ключ идемпотентности заменён на `<key>`
|
||||
|
||||
```text
|
||||
evidence: secrets checked: 13, files: 577, hits: 0, home paths: 0, authorization with credentials: 0
|
||||
tracked: secrets checked: 13, files: 1285, hits: 0, home paths: 0, authorization with credentials: 1
|
||||
authorization: examples/requests.http
|
||||
tracked .env or config.toml in any branch history: 0
|
||||
```
|
||||
@@ -0,0 +1,23 @@
|
||||
# Быстрые тесты сервисов
|
||||
|
||||
- Команды: `make service_test`, затем `make service_test_db`
|
||||
- Дата: 2026-11-15, 06:50:24–06:51:04 UTC; оба — код выхода 0
|
||||
- Commit: `db3340d` (ветка `feat/lab6-final`), рабочее дерево без правок кода (изменены только `QUESTIONS.md` и файлы `evidence/`)
|
||||
- Стенд: `make service_test` — без PostgreSQL, Valkey, S3, брокера, docker и сети (фейки, `service-tests/unit`); `make service_test_db` — PostgreSQL рабочего стенда `mtusi-lab6`, временная база `test_uow_messenger`, удалена после прогона (`service-tests/db`)
|
||||
- Итог: **335 passed за 2,88 с** (ветки всех сервисов, архитектура, контракт repo на фейке, телеметрия на in-memory экспортёрах SDK — `test_telemetry`); **88 passed за 34,04 с** на временной базе (настоящая единица работы, контракт repo на SQL, общий срок запроса, span запросов и COMMIT, счёт пула `CountingQueuePool`). В лабе 5 при переносе было 215 и 78: прибавились тесты телеметрии четырёх change лабы 6
|
||||
- Таблица регрессий (временная поломка кода → названный красный) — в лабе 5 (`evidence/tests/service-tests.md` её репозитория) и в `tasks.md` change лабы 6; здесь не переснималась
|
||||
|
||||
```text
|
||||
uv run pytest -c service-tests/pytest.ini service-tests/unit
|
||||
........................................................................ [ 21%]
|
||||
........................................................................ [ 42%]
|
||||
........................................................................ [ 64%]
|
||||
........................................................................ [ 85%]
|
||||
............................................... [100%]
|
||||
335 passed in 2.88s
|
||||
```
|
||||
|
||||
```text
|
||||
................ [100%]
|
||||
88 passed in 34.04s
|
||||
```
|
||||
@@ -0,0 +1,25 @@
|
||||
# Свой набор через LB
|
||||
|
||||
- Команда: `make student_test` (`BASE_URL=http://localhost:8080 EXPECT_REPLICAS=2`)
|
||||
- Дата: 2026-11-15, 06:44:13–06:45:31 UTC; код выхода 0
|
||||
- Commit: `db3340d` (ветка `feat/lab6-final`), рабочее дерево без правок кода (изменены только `QUESTIONS.md` и файлы `evidence/`, в образ они не входят)
|
||||
- Стенд: проект compose `mtusi-lab6`, две реплики за HAProxy, relay, worker, телеметрия включена (Collector, Prometheus, Loki, Tempo, Grafana), собран `make run_docker` из `HEAD`
|
||||
- Итог: **224 passed, 147 deselected, 77,59 с**. 147 deselected — проверки отказов (`evidence/tests/failure-checks.md`)
|
||||
- `test_exclusion_evidence_exists` зелёный: все 10 файлов исключений сняты на стенде лабы 6 (`evidence/cache/hits.md`, `evidence/auth/passwords-and-tokens.md`, `evidence/idempotency/replay-after-restart.md`, `evidence/replicas/test-persistence.md`, `evidence/attachments/failover.md`, `evidence/attachments/storage.md`, `evidence/broker/stand.md`, `evidence/broker/isolated.md`, `evidence/uploads/baseline/summary.md`, `evidence/queue/baseline4/summary.md`)
|
||||
- Вывод сокращён: убраны строки `PASSED` и заголовки блоков вывода
|
||||
|
||||
```text
|
||||
student-tests/test_coverage.py::test_exclusion_evidence_exists PASSED [ 50%]
|
||||
uploaded via d34fc9b86aa4, downloaded via ['35f606496f73', 'd34fc9b86aa4']
|
||||
coverage: 389 scenarios in 17 specs, 358 tested (173 by make failure_checks), 31 excluded
|
||||
sent via d34fc9b86aa4, replayed via ['35f606496f73']
|
||||
409 via ['35f606496f73', 'd34fc9b86aa4']
|
||||
one session, 20 requests: {'35f606496f73': 10, 'd34fc9b86aa4': 10}
|
||||
written via d34fc9b86aa4, read via {'35f606496f73': 3, 'd34fc9b86aa4': 3}
|
||||
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
|
||||
key race: 10 clients, statuses {201: 10}, max in flight 10; history: 1 messages
|
||||
key race through replicas: {'35f606496f73': 5, 'd34fc9b86aa4': 5}
|
||||
================ 224 passed, 147 deselected in 77.59s (0:01:17) ================
|
||||
```
|
||||
@@ -0,0 +1,32 @@
|
||||
# Набор на временной базе
|
||||
|
||||
- Команда: `make test_isolated`
|
||||
- Дата: 2026-11-15, 06:45:55–06:48:10 UTC; код выхода 0 (`results: {'test': 0, 'student_test': 0}`)
|
||||
- Commit: `db3340d` (ветка `feat/lab6-final`), рабочее дерево без правок кода (изменены только `QUESTIONS.md` и файлы `evidence/`, в образ они не входят)
|
||||
- Стенд: образ из рабочего дерева, контейнеры `mtusi-lab6-test-api`, `mtusi-lab6-test-worker`, `mtusi-lab6-test-relay` на базе `test_messenger` поверх хранилищ рабочего стенда (телеметрия у них выключена, `TELEMETRY__ENABLED=false`), один процесс API, `EXPECT_REPLICAS=1`
|
||||
- Итог: smoke — `PASS: lab6`; набор — **218 passed, 6 skipped, 147 deselected, 116,06 с**. Это третий прогон этой сессии: первые два — последовательность `evidence/broker/isolated.md` (код 2 только из-за ещё не снятых файлов исключений)
|
||||
- 6 skipped — тесты реплик против одного процесса, причина напечатана; 147 deselected — проверки отказов (`evidence/tests/failure-checks.md`)
|
||||
- Вывод сокращён: убраны лог сборки и строки `PASSED`
|
||||
|
||||
```text
|
||||
python3 tests/smoke.py --base-url "http://127.0.0.1:18088"
|
||||
PASS: lab6 public API scenario; infrastructure and grading evidence remain separate.
|
||||
|
||||
student-tests/test_coverage.py::test_exclusion_evidence_exists PASSED [ 50%]
|
||||
two series of 18 requests: {'47af42477da4': 36}
|
||||
ready in 0.44 s
|
||||
coverage: 389 scenarios in 17 specs, 358 tested (173 by make failure_checks), 31 excluded
|
||||
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_attachment_processing.py:511: one API process (EXPECT_REPLICAS=1): replica checks need the stand with the load balancer
|
||||
SKIPPED [1] student-tests/test_attachments.py:748: one API process (EXPECT_REPLICAS=1): replica checks need the stand with the load balancer
|
||||
SKIPPED [1] student-tests/test_idempotency.py:372: 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
|
||||
========== 218 passed, 6 skipped, 147 deselected in 116.06s (0:01:56) ==========
|
||||
[test_isolated] cleanup
|
||||
[test_isolated] remove objects /buckets/messenger/test_messenger/ and queue test_messenger.attachment.process.v1
|
||||
[test_isolated] results: {'test': 0, 'student_test': 0}
|
||||
```
|
||||
Reference in New Issue
Block a user