Lab2
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
PostgreSQL, серверные сессии и Valkey
|
PostgreSQL, серверные сессии и Valkey
|
||||||
|
|
||||||
- Автор, группа: Максимова Мария, БВТ2303
|
- Автор, группа: Максимова Мария, БВТ2303
|
||||||
- Целевая оценка: 4 (трек уровня 5 не заявлен)
|
- Целевая оценка: 4
|
||||||
- Commit / PR: `TODO` — подставить `git rev-parse --short HEAD` после финального коммита
|
- Commit / PR: `TODO` — подставить `git rev-parse --short HEAD` после финального коммита
|
||||||
- Использованные средства: Python 3.12.7 (в Docker), FastAPI, SQLAlchemy 2 (async) + asyncpg, argon2-cffi, redis-py 5 (клиент Valkey), PostgreSQL 16.4, Valkey 8.0.1, Docker Desktop + WSL2.
|
- Использованные средства: Python 3.12.7 (в Docker), FastAPI, SQLAlchemy 2 (async) + asyncpg, argon2-cffi, redis-py 5 (клиент Valkey), PostgreSQL 16.4, Valkey 8.0.1, Docker Desktop + WSL2.
|
||||||
- Источники: документация PostgreSQL (EXPLAIN, сравнение строк/row comparison, транзакции, WAL), документация Valkey (persistence, `SET NX`, `EX`), RFC 7617 (HTTP Basic), документация FastAPI и SQLAlchemy.
|
- Источники: документация PostgreSQL (EXPLAIN, сравнение строк/row comparison, транзакции, WAL), документация Valkey (persistence, `SET NX`, `EX`), RFC 7617 (HTTP Basic), документация FastAPI и SQLAlchemy.
|
||||||
@@ -23,7 +23,7 @@ PostgreSQL, серверные сессии и Valkey
|
|||||||
|
|
||||||
Контракт lab1 (users/chats/messages, keyset-пагинация с непрозрачным cursor, единый формат ошибок, `X-Request-Id`) сохранён. Изменена только аутентификация, как требует контракт lab2.
|
Контракт lab1 (users/chats/messages, keyset-пагинация с непрозрачным cursor, единый формат ошибок, `X-Request-Id`) сохранён. Изменена только аутентификация, как требует контракт lab2.
|
||||||
|
|
||||||
## 2. Соответствие критериям
|
## 2. Соответствие критериям
|
||||||
|
|
||||||
### 2.1. Оценка «3»
|
### 2.1. Оценка «3»
|
||||||
|
|
||||||
@@ -73,6 +73,9 @@ PostgreSQL, серверные сессии и Valkey
|
|||||||
|
|
||||||
Все команды выполняются из корня репозитория.
|
Все команды выполняются из корня репозитория.
|
||||||
|
|
||||||
|
cd /mnt/c/Users/masha/WebstormProjects/mtusi2026lab2
|
||||||
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# 1. Сгенерировать локальные secrets (случайные пароли; в Git не попадают)
|
# 1. Сгенерировать локальные secrets (случайные пароли; в Git не попадают)
|
||||||
sh scripts/init-secrets.sh
|
sh scripts/init-secrets.sh
|
||||||
@@ -495,32 +498,35 @@ git status --short # secrets и venv в списке отсутствуют
|
|||||||
| Successful RPS | ≈ 291 |
|
| Successful RPS | ≈ 291 |
|
||||||
| p50 / p95 / p99 | 13.0 / 18.5 / 30.3 ms |
|
| p50 / p95 / p99 | 13.0 / 18.5 / 30.3 ms |
|
||||||
|
|
||||||
Это один прогон, генератор нагрузки работает на той же машине, у closed-loop есть coordinated omission, CPU/RAM не измерялись. Это не оценка максимальной пропускной способности, а подтверждение, что API стабильно пишет под параллельной нагрузкой без ошибок. Для сравнения: ранний прогон без Valkey дал 4 803 запроса / 319.89 RPS / p95 15.8 ms. Разница в пределах разброса одиночных прогонов на Docker Desktop, выводов о влиянии кэша на запись отсюда не делается.
|
Это один прогон, генератор нагрузки работает на той же машине, у closed-loop есть coordinated omission, CPU/RAM не измерялись.
|
||||||
|
Это не оценка максимальной пропускной способности, а подтверждение, что API стабильно пишет под параллельной нагрузкой без ошибок.
|
||||||
|
Для сравнения: ранний прогон без Valkey дал 4 803 запроса / 319.89 RPS / p95 15.8 ms.
|
||||||
|
Разница в пределах разброса одиночных прогонов на Docker Desktop, выводов о влиянии кэша на запись отсюда не делается.
|
||||||
|
|
||||||
### 13.2. Отказы
|
### 13.2. Отказы
|
||||||
|
|
||||||
| Воздействие | Ожидание | Наблюдение | Восстановление / потеря данных |
|
| Воздействие | Ожидание | Наблюдение | Восстановление / потеря данных |
|
||||||
|---------------------------------------------------------------|-----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
|
|---------------------------------------------------------------|-----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
|
||||||
| `scripts/restart.sh` (`docker compose restart db valkey api`) | данные и сессия сохранены | persistence PASS со старым токеном, без повторного входа; `CreatedAt` volume не изменился | готовность за несколько секунд / потерь нет |
|
| `scripts/restart.sh` (`docker compose restart db valkey api`) | данные и сессия сохранены | persistence PASS со старым токеном, без повторного входа; `CreatedAt` volume не изменился | готовность за несколько секунд / потерь нет |
|
||||||
| `docker compose stop valkey` | обход кэша через PostgreSQL | вход, чтение и запись успешны, задержка ≤ 0.30 s; поддельный и анонимный запросы → 401 | сразу; после старта кэш пуст и заполняется заново |
|
| `docker compose stop valkey` | обход кэша через PostgreSQL | вход, чтение и запись успешны, задержка ≤ 0.30 s; поддельный и анонимный запросы → 401 | сразу; после старта кэш пуст и заполняется заново |
|
||||||
| `docker compose pause valkey` (зависание) | таймаут 0.25 s, затем обход 5 s | задержка ≤ 0.26 s; токен, отозванный во время отказа, после `unpause` остаётся 401 благодаря `FLUSHDB` | ~5 s до возврата к кэшу / потерь нет |
|
| `docker compose pause valkey` (зависание) | таймаут 0.25 s, затем обход 5 s | задержка ≤ 0.26 s; токен, отозванный во время отказа, после `unpause` остаётся 401 благодаря `FLUSHDB` | ~5 s до возврата к кэшу / потерь нет |
|
||||||
| `docker compose stop db` | ограниченный 503, анонимным не доверяем | запись и вход → `503 unavailable` с `request_id` за ~3 s; `ready` 503, `live` 200; анонимный 401; непроверяемый токен 503, никогда 2xx | после `start db` API снова ready, старый токен снова пишет / подтверждённые данные на volume |
|
| `docker compose stop db` | ограниченный 503, анонимным не доверяем | запись и вход → `503 unavailable` с `request_id` за ~3 s; `ready` 503, `live` 200; анонимный 401; непроверяемый токен 503, никогда 2xx | после `start db` API снова ready, старый токен снова пишет / подтверждённые данные на volume |
|
||||||
| 20 параллельных регистраций одного username | один 201, остальные 409 | `{201: 1, 409: 19}`, ни одного 500 | — |
|
| 20 параллельных регистраций одного username | один 201, остальные 409 | `{201: 1, 409: 19}`, ни одного 500 | — |
|
||||||
|
|
||||||
|
|
||||||
## 14. Доказательства
|
## 14. Доказательства
|
||||||
|
|
||||||
| Файл | Команда | Результат |
|
| Файл | Команда | Результат |
|
||||||
|-------------------------------------------|----------------------------------------------------------|-------------------------------------------------------------------|
|
|-------------------------------------------|------------------------------------------------------------|-------------------------------------------------------------------|
|
||||||
| `evidence/check_contract.txt` | `make check` | `PASS: offline skeleton structure, local refs and Python syntax` |
|
| `evidence/check_contract.txt` | `make check` | `PASS: offline skeleton structure, local refs and Python syntax` |
|
||||||
| `evidence/validate_openapi.txt` | `make validate` | `PASS: full OpenAPI 3.1 and JSON Schema validation` |
|
| `evidence/validate_openapi.txt` | `make validate` | `PASS: full OpenAPI 3.1 and JSON Schema validation` |
|
||||||
| `evidence/smoke.txt` | `make test` | `PASS: lab2 public API scenario` |
|
| `evidence/smoke.txt` | `make test` | `PASS: lab2 public API scenario` |
|
||||||
| `evidence/persistence.txt` | `make test-persistence ACTION_SCRIPT=scripts/restart.sh` | `PASS: persistence preserved confirmed data and existing session` |
|
| `evidence/persistence.txt` | `make test-persistence ACTION_SCRIPT=scripts/restart.sh` | `PASS: persistence preserved confirmed data and existing session` |
|
||||||
| `evidence/migrations_repeat.txt` | `docker compose run --rm migrate` | `SKIP 001…`, `SKIP 002…`, `PASS` |
|
| `evidence/migrations_repeat.txt` | `docker compose run --rm migrate` | `SKIP 001…`, `SKIP 002…`, `PASS` |
|
||||||
| `evidence/level4.txt` | `make test-level4` | `PASS: level 4 checks` |
|
| `evidence/level4.txt` | `make test-level4` | `PASS: level 4 checks` |
|
||||||
| `evidence/explain.txt` | `make db-checks` | rollback PASS, планы EXPLAIN |
|
| `evidence/explain.txt` | `make db-checks` | rollback PASS, планы EXPLAIN |
|
||||||
| `evidence/load.txt`, `evidence/load.json` | `tests/load.py --duration 15 --concurrency 4` | агрегаты раздела 13.1 |
|
| `evidence/load.txt`, `evidence/load.json` | `python3 tests/load.py --duration 15 --concurrency 4` | агрегаты раздела 13.1 |
|
||||||
| `evidence/README.md` | — | контекст, commit, стенд, профиль нагрузки |
|
| `evidence/README.md` | — | контекст, commit, стенд, профиль нагрузки |
|
||||||
|
|
||||||
`scripts/check_contract.py` и `scripts/validate_openapi.py` проверяют только репозиторий и контракт, приложение они не запускают. Поведение API доказывают smoke, persistence, level4 и db-checks.
|
`scripts/check_contract.py` и `scripts/validate_openapi.py` проверяют только репозиторий и контракт, приложение они не запускают. Поведение API доказывают smoke, persistence, level4 и db-checks.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@
|
|||||||
## Нагрузка
|
## Нагрузка
|
||||||
|
|
||||||
Профиль: 4 concurrent клиента, 15 seconds, closed-loop `POST /api/v1/chats/{chat_id}/messages`, без automatic retries.
|
Профиль: 4 concurrent клиента, 15 seconds, closed-loop `POST /api/v1/chats/{chat_id}/messages`, без automatic retries.
|
||||||
Результат: 4374 успешных запроса, 0 ошибок, ≈291 RPS, p50/p95/p99 = 13.0/18.5/30.3 ms.
|
Результат: 3324 успешных запроса, 0 ошибок, ≈221 RPS, p50/p95/p99 = 15.8/30.1/59.6 ms.
|
||||||
|
|
||||||
Это локальное измерение на Docker Desktop/WSL2, а не production SLA.
|
Это локальное измерение на Docker Desktop/WSL2, а не production SLA.
|
||||||
Latency включает client overhead; closed-loop нагрузка подвержена coordinated omission.
|
Latency включает client overhead; closed-loop нагрузка подвержена coordinated omission.
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
|
||||||
|
|||||||
+37
-37
@@ -5,64 +5,64 @@ PASS: chat row was rolled back together with members
|
|||||||
PASS: no chats without members exist in the database
|
PASS: no chats without members exist in the database
|
||||||
|
|
||||||
== EXPLAIN for message history pagination
|
== EXPLAIN for message history pagination
|
||||||
messages total: 83665; in explained chat: 10000
|
messages total: 50003; in explained chat: 10000
|
||||||
PASS: explained chat has >= 10 000 messages
|
PASS: explained chat has >= 10 000 messages
|
||||||
|
|
||||||
-- first page
|
-- first page
|
||||||
Limit (actual time=0.014..0.022 rows=51 loops=1)
|
Limit (actual time=0.010..0.016 rows=51 loops=1)
|
||||||
Buffers: shared hit=4
|
Buffers: shared hit=4
|
||||||
-> Index Scan using messages_keyset_idx on messages (actual time=0.013..0.019 rows=51 loops=1)
|
-> Index Scan using messages_keyset_idx on messages (actual time=0.010..0.013 rows=51 loops=1)
|
||||||
Index Cond: (chat_id = 'd00c8d51-a786-404d-aea9-c8447ec0614b'::uuid)
|
Index Cond: (chat_id = '7c57b8e9-42a1-4cf8-904b-08545328a890'::uuid)
|
||||||
Buffers: shared hit=4
|
Buffers: shared hit=4
|
||||||
Planning:
|
Planning:
|
||||||
Buffers: shared hit=6
|
Buffers: shared hit=6
|
||||||
Planning Time: 0.096 ms
|
Planning Time: 0.131 ms
|
||||||
Execution Time: 0.045 ms
|
Execution Time: 0.035 ms
|
||||||
|
|
||||||
-- keyset page after position 9000
|
-- keyset page after position 9000
|
||||||
Limit (actual time=0.025..0.036 rows=51 loops=1)
|
Limit (actual time=0.012..0.021 rows=51 loops=1)
|
||||||
Buffers: shared hit=4 read=1
|
Buffers: shared hit=5
|
||||||
-> Index Scan using messages_keyset_idx on messages (actual time=0.024..0.032 rows=51 loops=1)
|
-> Index Scan using messages_keyset_idx on messages (actual time=0.011..0.018 rows=51 loops=1)
|
||||||
Index Cond: ((chat_id = 'd00c8d51-a786-404d-aea9-c8447ec0614b'::uuid) AND (ROW(created_at, id) > ROW('2026-09-28 16:11:52.757537+00'::timestamp with time zone, 'cab6bb16-0f15-46a0-8f5e-13cb8416fd5e'::uuid)))
|
Index Cond: ((chat_id = '7c57b8e9-42a1-4cf8-904b-08545328a890'::uuid) AND (ROW(created_at, id) > ROW('2026-10-01 07:31:21.6187+00'::timestamp with time zone, '6cbb1e03-f1e2-4113-8a7b-612c90c9761f'::uuid)))
|
||||||
Buffers: shared hit=4 read=1
|
Buffers: shared hit=5
|
||||||
Planning Time: 0.058 ms
|
Planning Time: 0.043 ms
|
||||||
Execution Time: 0.097 ms
|
Execution Time: 0.104 ms
|
||||||
|
|
||||||
-- OFFSET 9000 (not used by the API)
|
-- OFFSET 9000 (not used by the API)
|
||||||
Limit (actual time=5.664..5.672 rows=51 loops=1)
|
Limit (actual time=3.723..3.729 rows=51 loops=1)
|
||||||
Buffers: shared hit=265
|
Buffers: shared hit=207
|
||||||
-> Sort (actual time=4.983..5.386 rows=9051 loops=1)
|
-> Sort (actual time=3.127..3.460 rows=9051 loops=1)
|
||||||
Sort Key: created_at, id
|
Sort Key: created_at, id
|
||||||
Sort Method: quicksort Memory: 1713kB
|
Sort Method: quicksort Memory: 1713kB
|
||||||
Buffers: shared hit=265
|
Buffers: shared hit=207
|
||||||
-> Bitmap Heap Scan on messages (actual time=0.311..1.323 rows=10000 loops=1)
|
-> Bitmap Heap Scan on messages (actual time=0.321..0.920 rows=10000 loops=1)
|
||||||
Recheck Cond: (chat_id = 'd00c8d51-a786-404d-aea9-c8447ec0614b'::uuid)
|
Recheck Cond: (chat_id = '7c57b8e9-42a1-4cf8-904b-08545328a890'::uuid)
|
||||||
Heap Blocks: exact=134
|
Heap Blocks: exact=134
|
||||||
Buffers: shared hit=265
|
Buffers: shared hit=207
|
||||||
-> Bitmap Index Scan on messages_keyset_idx (actual time=0.291..0.292 rows=10000 loops=1)
|
-> Bitmap Index Scan on messages_keyset_idx (actual time=0.307..0.308 rows=10000 loops=1)
|
||||||
Index Cond: (chat_id = 'd00c8d51-a786-404d-aea9-c8447ec0614b'::uuid)
|
Index Cond: (chat_id = '7c57b8e9-42a1-4cf8-904b-08545328a890'::uuid)
|
||||||
Buffers: shared hit=131
|
Buffers: shared hit=73
|
||||||
Planning Time: 0.132 ms
|
Planning Time: 0.040 ms
|
||||||
Execution Time: 5.876 ms
|
Execution Time: 3.848 ms
|
||||||
|
|
||||||
-- keyset page WITHOUT messages_keyset_idx (rolled back)
|
-- keyset page WITHOUT messages_keyset_idx (rolled back)
|
||||||
Limit (actual time=5.998..6.007 rows=51 loops=1)
|
Limit (actual time=1.882..1.886 rows=51 loops=1)
|
||||||
Buffers: shared hit=1106
|
Buffers: shared hit=667
|
||||||
-> Sort (actual time=5.996..5.999 rows=51 loops=1)
|
-> Sort (actual time=1.880..1.882 rows=51 loops=1)
|
||||||
Sort Key: created_at, id
|
Sort Key: created_at, id
|
||||||
Sort Method: top-N heapsort Memory: 31kB
|
Sort Method: top-N heapsort Memory: 31kB
|
||||||
Buffers: shared hit=1106
|
Buffers: shared hit=667
|
||||||
-> Seq Scan on messages (actual time=1.232..5.880 rows=999 loops=1)
|
-> Seq Scan on messages (actual time=0.386..1.804 rows=999 loops=1)
|
||||||
Filter: ((chat_id = 'd00c8d51-a786-404d-aea9-c8447ec0614b'::uuid) AND (ROW(created_at, id) > ROW('2026-09-28 16:11:52.757537+00'::timestamp with time zone, 'cab6bb16-0f15-46a0-8f5e-13cb8416fd5e'::uuid)))
|
Filter: ((chat_id = '7c57b8e9-42a1-4cf8-904b-08545328a890'::uuid) AND (ROW(created_at, id) > ROW('2026-10-01 07:31:21.6187+00'::timestamp with time zone, '6cbb1e03-f1e2-4113-8a7b-612c90c9761f'::uuid)))
|
||||||
Rows Removed by Filter: 82666
|
Rows Removed by Filter: 49004
|
||||||
Buffers: shared hit=1106
|
Buffers: shared hit=667
|
||||||
Planning:
|
Planning:
|
||||||
Buffers: shared hit=4
|
Buffers: shared hit=4
|
||||||
Planning Time: 0.166 ms
|
Planning Time: 0.088 ms
|
||||||
Execution Time: 6.063 ms
|
Execution Time: 1.920 ms
|
||||||
PASS: first page reads the index in order, no Sort
|
PASS: first page reads the index in order, no Sort
|
||||||
PASS: keyset cursor is an Index Cond, not a filter over the history
|
PASS: keyset cursor is an Index Cond, not a filter over the history
|
||||||
PASS: keyset deep page touches fewer buffers than OFFSET (5 < 265)
|
PASS: keyset deep page touches fewer buffers than OFFSET (5 < 207)
|
||||||
PASS: index reduces buffers for the deep page (5 < 1106)
|
PASS: index reduces buffers for the deep page (5 < 667)
|
||||||
|
|
||||||
PASS: db checks
|
PASS: db checks
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ PASS: forged token still 401 without Valkey
|
|||||||
PASS: anonymous still 401 without Valkey
|
PASS: anonymous still 401 without Valkey
|
||||||
PASS: logout works without Valkey
|
PASS: logout works without Valkey
|
||||||
PASS: token revoked during outage -> 401
|
PASS: token revoked during outage -> 401
|
||||||
PASS: bounded latency during outage (max 0.26s)
|
PASS: bounded latency during outage (max 0.27s)
|
||||||
PASS: token revoked during outage stays 401 after Valkey returns (stale cache flushed)
|
PASS: token revoked during outage stays 401 after Valkey returns (stale cache flushed)
|
||||||
PASS: live session works after recovery
|
PASS: live session works after recovery
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -2,16 +2,16 @@
|
|||||||
"lab": 2,
|
"lab": 2,
|
||||||
"workload": "closed-loop POST messages; no automatic retries",
|
"workload": "closed-loop POST messages; no automatic retries",
|
||||||
"requested_duration_seconds": 15.0,
|
"requested_duration_seconds": 15.0,
|
||||||
"elapsed_seconds": 15.022,
|
"elapsed_seconds": 15.026,
|
||||||
"concurrency": 4,
|
"concurrency": 4,
|
||||||
"successful_requests": 2519,
|
"successful_requests": 3324,
|
||||||
"failed_requests": 0,
|
"failed_requests": 0,
|
||||||
"error_ratio": 0.0,
|
"error_ratio": 0.0,
|
||||||
"successful_rps": 167.693,
|
"successful_rps": 221.222,
|
||||||
"successful_latency_ms": {
|
"successful_latency_ms": {
|
||||||
"p50": 21.44,
|
"p50": 15.779,
|
||||||
"p95": 38.631,
|
"p95": 30.073,
|
||||||
"p99": 48.175
|
"p99": 59.585
|
||||||
},
|
},
|
||||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -2,16 +2,16 @@
|
|||||||
"lab": 2,
|
"lab": 2,
|
||||||
"workload": "closed-loop POST messages; no automatic retries",
|
"workload": "closed-loop POST messages; no automatic retries",
|
||||||
"requested_duration_seconds": 15.0,
|
"requested_duration_seconds": 15.0,
|
||||||
"elapsed_seconds": 15.022,
|
"elapsed_seconds": 15.026,
|
||||||
"concurrency": 4,
|
"concurrency": 4,
|
||||||
"successful_requests": 2519,
|
"successful_requests": 3324,
|
||||||
"failed_requests": 0,
|
"failed_requests": 0,
|
||||||
"error_ratio": 0.0,
|
"error_ratio": 0.0,
|
||||||
"successful_rps": 167.693,
|
"successful_rps": 221.222,
|
||||||
"successful_latency_ms": {
|
"successful_latency_ms": {
|
||||||
"p50": 21.44,
|
"p50": 15.779,
|
||||||
"p95": 38.631,
|
"p95": 30.073,
|
||||||
"p99": 48.175
|
"p99": 59.585
|
||||||
},
|
},
|
||||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-10
@@ -1,14 +1,14 @@
|
|||||||
## containers before restart hook
|
## containers before restart hook
|
||||||
api running Up About a minute 2026-10-01 22:00:19 +0300 MSK
|
api running Up 49 seconds 2026-10-02 09:47:54 +0300 MSK
|
||||||
api_short_ttl running Up 4 minutes 2026-10-01 22:00:19 +0300 MSK
|
api_short_ttl running Up 49 seconds 2026-10-02 09:47:54 +0300 MSK
|
||||||
db running Up About a minute (healthy) 2026-09-29 20:09:08 +0300 MSK
|
db running Up 2 minutes (healthy) 2026-10-02 09:39:03 +0300 MSK
|
||||||
migrate exited Exited (0) 4 minutes ago 2026-10-01 22:00:19 +0300 MSK
|
migrate exited Exited (0) 53 seconds ago 2026-10-02 09:47:53 +0300 MSK
|
||||||
valkey running Up About a minute (healthy) 2026-09-29 20:09:08 +0300 MSK
|
valkey running Up 55 seconds (healthy) 2026-10-02 09:47:53 +0300 MSK
|
||||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||||
## containers after restart hook (Status shows new uptime)
|
## containers after restart hook (Status shows new uptime)
|
||||||
api running Up 1 second 2026-10-01 22:00:19 +0300 MSK
|
api running Up 2 seconds 2026-10-02 09:47:54 +0300 MSK
|
||||||
api_short_ttl running Up 4 minutes 2026-10-01 22:00:19 +0300 MSK
|
api_short_ttl running Up 54 seconds 2026-10-02 09:47:54 +0300 MSK
|
||||||
db running Up 2 seconds (health: starting) 2026-09-29 20:09:08 +0300 MSK
|
db running Up 3 seconds (health: starting) 2026-10-02 09:39:03 +0300 MSK
|
||||||
migrate exited Exited (0) 4 minutes ago 2026-10-01 22:00:19 +0300 MSK
|
migrate exited Exited (0) 58 seconds ago 2026-10-02 09:47:53 +0300 MSK
|
||||||
valkey running Up 2 seconds (health: starting) 2026-09-29 20:09:08 +0300 MSK
|
valkey running Up 3 seconds (health: starting) 2026-10-02 09:47:53 +0300 MSK
|
||||||
|
|||||||
@@ -12,6 +12,13 @@ PYTHON="${PYTHON:-python3}"
|
|||||||
if [ -x .venv-wsl/bin/python3 ]; then PYTHON=.venv-wsl/bin/python3; fi
|
if [ -x .venv-wsl/bin/python3 ]; then PYTHON=.venv-wsl/bin/python3; fi
|
||||||
if [ -x .venv/bin/python3 ]; then PYTHON=.venv/bin/python3; fi
|
if [ -x .venv/bin/python3 ]; then PYTHON=.venv/bin/python3; fi
|
||||||
|
|
||||||
|
# Do not overwrite evidence/ with failures of a stand that is not running.
|
||||||
|
if ! curl -fsS --max-time 5 http://localhost:8080/health/ready >/dev/null 2>&1 || ! curl -fsS --max-time 5 http://localhost:8081/health/ready >/dev/null 2>&1; then
|
||||||
|
echo "API is not running. Start it first:" >&2
|
||||||
|
echo " docker compose --profile tests up -d --build api api_short_ttl" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
containers() {
|
containers() {
|
||||||
docker compose ps -a --format '{{.Service}}\t{{.State}}\t{{.Status}}\t{{.CreatedAt}}'
|
docker compose ps -a --format '{{.Service}}\t{{.State}}\t{{.Status}}\t{{.CreatedAt}}'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user