forked from mtusi2026/mtusi2026lab5
lab5: e2e, fault suite и доказательства
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
big_image: peak worker memory: 577.0 MiB / 1280 MiB
|
||||
invariants: {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true}
|
||||
duration_s: 22.697
|
||||
peak accounting: two worst_decode_png (8000x5000) uploaded concurrently; worker limit 1280 MiB; OOMKilled=false
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
> app@0.0.1 build
|
||||
> nest build
|
||||
|
||||
|
||||
> app@0.0.1 lint
|
||||
> oxlint src/ test/
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
|
||||
mtusi-lab5-api-1 mtusi-messenger:lab5 "docker-entrypoint.s…" api 6 minutes ago Up 37 seconds (healthy) 8080/tcp
|
||||
mtusi-lab5-api-2 mtusi-messenger:lab5 "docker-entrypoint.s…" api 6 minutes ago Up 37 seconds (healthy) 8080/tcp
|
||||
mtusi-lab5-broker-1 rabbitmq:4.1.8-alpine@sha256:153322e3974e6365c50e523e5eadd5a7fae231f0e8c58f67c03bb3e02056e34e "docker-entrypoint.s…" broker 56 minutes ago Up 39 seconds (healthy) 4369/tcp, 5671-5672/tcp, 15691-15692/tcp, 25672/tcp
|
||||
mtusi-lab5-haproxy-1 haproxy:3.2-alpine "docker-entrypoint.s…" haproxy 56 minutes ago Up About a minute 0.0.0.0:8080->8080/tcp, [::]:8080->8080/tcp, 127.0.0.1:8404->8404/tcp
|
||||
mtusi-lab5-postgres-1 postgres:16.4-alpine "docker-entrypoint.s…" postgres 56 minutes ago Up About a minute (healthy) 127.0.0.1:5432->5432/tcp
|
||||
mtusi-lab5-redis-1 redis:7.4.2-alpine "docker-entrypoint.s…" redis 56 minutes ago Up About a minute (healthy) 127.0.0.1:6379->6379/tcp
|
||||
mtusi-lab5-s3-1 minio/minio:RELEASE.2025-09-07T16-13-09Z@sha256:14cea493d9a34af32f524e538b8346cf79f3321eff8e708c1e2960462bd8936e "/usr/bin/docker-ent…" s3 56 minutes ago Up About a minute (healthy) 127.0.0.1:9000->9000/tcp
|
||||
mtusi-lab5-worker-1 mtusi-messenger:lab5 "docker-entrypoint.s…" worker 6 minutes ago Up 5 seconds (healthy) 8080/tcp
|
||||
@@ -0,0 +1,4 @@
|
||||
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8080"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 124, "failed_attempts": 0, "first_recovery_seconds": 3.474}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
@@ -0,0 +1,138 @@
|
||||
[
|
||||
{
|
||||
"name": "crash_after_commit_before_publish",
|
||||
"repeat": 1,
|
||||
"passed": true,
|
||||
"duration_s": 16.402,
|
||||
"attachment_id": "5a030f81-3967-43aa-94ba-3ef24f043efe",
|
||||
"job_attempts": [
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "outbox relay published the committed job after API restart"
|
||||
},
|
||||
{
|
||||
"name": "crash_after_side_effect",
|
||||
"repeat": 1,
|
||||
"passed": true,
|
||||
"duration_s": 42.306,
|
||||
"attachment_id": "fd01701f-635e-43d9-b41a-86cfbf654af1",
|
||||
"job_attempts": [
|
||||
2
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "crashed at worker.after_side_effect"
|
||||
},
|
||||
{
|
||||
"name": "crash_after_commit_before_ack",
|
||||
"repeat": 1,
|
||||
"passed": true,
|
||||
"duration_s": 33.299,
|
||||
"attachment_id": "8e1752c9-e073-4d0a-b858-fff8fbc156ff",
|
||||
"job_attempts": [
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "crashed at worker.after_commit_before_ack"
|
||||
},
|
||||
{
|
||||
"name": "retry_and_replay",
|
||||
"repeat": 1,
|
||||
"passed": true,
|
||||
"duration_s": 44.868,
|
||||
"attachment_id": "721aa545-6d6d-4c5e-a353-dc8e39751442",
|
||||
"job_attempts": [
|
||||
6
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "transient injected fault exhausted retries; replay recovered"
|
||||
},
|
||||
{
|
||||
"name": "hung_worker",
|
||||
"repeat": 1,
|
||||
"passed": true,
|
||||
"duration_s": 44.634,
|
||||
"attachment_id": "fb451ee8-cf2c-423a-9e22-a95ec00d58fd",
|
||||
"job_attempts": [
|
||||
2
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "hard timeout aborted the hung render and retried"
|
||||
},
|
||||
{
|
||||
"name": "poison",
|
||||
"repeat": 1,
|
||||
"passed": true,
|
||||
"duration_s": 22.962,
|
||||
"attachment_id": null,
|
||||
"job_attempts": [],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "malformed messages moved to the DLQ without touching jobs"
|
||||
},
|
||||
{
|
||||
"name": "big_image",
|
||||
"repeat": 1,
|
||||
"passed": true,
|
||||
"duration_s": 22.697,
|
||||
"attachment_id": "9eae2f87-64e0-4e27-bdf5-cc04b77c4a8d",
|
||||
"job_attempts": [],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "peak worker memory: 577.0 MiB / 1280 MiB"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,9 @@
|
||||
python3 scripts/lab5/fault_suite.py --base-url "http://localhost:8080" --scenario level4 --output evidence/lab5/faults-level4.json
|
||||
PASS crash_after_commit_before_publish #1 16.402s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} outbox relay published the committed job after API restart
|
||||
PASS crash_after_side_effect #1 42.306s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} crashed at worker.after_side_effect
|
||||
PASS crash_after_commit_before_ack #1 33.299s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} crashed at worker.after_commit_before_ack
|
||||
PASS retry_and_replay #1 44.868s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} transient injected fault exhausted retries; replay recovered
|
||||
PASS hung_worker #1 44.634s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} hard timeout aborted the hung render and retried
|
||||
PASS poison #1 22.962s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} malformed messages moved to the DLQ without touching jobs
|
||||
PASS big_image #1 22.697s {"I1": true, "I2": true, "I3": true, "I4": true, "I5": true, "I6": true} peak worker memory: 577.0 MiB / 1280 MiB
|
||||
7/7 scenarios passed
|
||||
@@ -0,0 +1,2 @@
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
@@ -0,0 +1,15 @@
|
||||
cd app && E2E_COMPOSE_DIR="/home/tomato/Projects/VP/mtusi2026lab5" E2E_COMPOSE_ENV_FILE=".env" npm run test:dependencies
|
||||
|
||||
> app@0.0.1 test:dependencies
|
||||
> E2E_DEPENDENCY_FAULTS=1 vitest run --config ./vitest.config.e2e.ts dependency-failures
|
||||
|
||||
The plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the resolve.tsconfigPaths option. You can remove the plugin and set resolve.tsconfigPaths: true in your Vite config instead.
|
||||
|
||||
RUN v4.1.11 /home/tomato/Projects/VP/mtusi2026lab5/app
|
||||
|
||||
|
||||
Test Files 1 passed (1)
|
||||
Tests 7 passed (7)
|
||||
Start at 01:10:32
|
||||
Duration 165.18s (transform 316ms, setup 0ms, import 378ms, tests 164.50s, environment 0ms)
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
scripts/app-e2e.sh
|
||||
|
||||
> app@0.0.1 test:e2e
|
||||
> vitest run --config ./vitest.config.e2e.ts
|
||||
|
||||
The plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the resolve.tsconfigPaths option. You can remove the plugin and set resolve.tsconfigPaths: true in your Vite config instead.
|
||||
|
||||
RUN v4.1.11 /home/tomato/Projects/VP/mtusi2026lab5/app
|
||||
|
||||
|
||||
Test Files 3 passed | 1 skipped (4)
|
||||
Tests 44 passed | 9 skipped (53)
|
||||
Start at 01:10:05
|
||||
Duration 22.44s (transform 858ms, setup 0ms, import 2.30s, tests 36.01s, environment 4ms)
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
python3 tests/smoke.py --base-url "http://localhost:8080"
|
||||
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,3 @@
|
||||
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:8080"
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
@@ -0,0 +1,3 @@
|
||||
{"process":{"messages":0,"consumers":1},"dlq":{"messages":10,"consumers":0}}
|
||||
|
||||
{"attachment":{"id":"6920d20c-b819-4d20-b922-ded8cd136467","status":"ready","error_code":null,"ready_pipeline_version":1,"staging_present":false},"jobs":[{"job_id":"da217f72-cc86-4621-a595-633821709c6a","pipeline_version":1,"status":"succeeded","attempt":1,"max_attempts":5,"last_error_code":null}],"variants":[{"pipeline_version":1,"variant":"thumbnail","sha256":"a18bfc29cd9311807ce56afc7078d45db13b19ac2ac14a31d2b91f2640eddf29","size_bytes":4101,"width":256,"height":160,"object_key":"attachments/6920d20c-b819-4d20-b922-ded8cd136467/v1/thumbnail.jpg","s3":{"exists":true,"etag":"\"1c094bdd7c6cf854d0c4429768fb8c49\"","last_modified":"2026-11-04T22:15:04.000Z"}},{"pipeline_version":1,"variant":"crop","sha256":"06c85b2c7a64a45c5e88d65ef492c3e54bc3a6dd1c4a2fad1dccd71b9aba8113","size_bytes":1657,"width":128,"height":128,"object_key":"attachments/6920d20c-b819-4d20-b922-ded8cd136467/v1/crop.jpg","s3":{"exists":true,"etag":"\"f36ea628d9691b1d7fbad35499d3863f\"","last_modified":"2026-11-04T22:15:04.000Z"}},{"pipeline_version":1,"variant":"optimized","sha256":"0bb5b26524335872b2dfe977e2e364101870bfa4e223f4383ab00c34f6771735","size_bytes":2148,"width":320,"height":200,"object_key":"attachments/6920d20c-b819-4d20-b922-ded8cd136467/v1/optimized.webp","s3":{"exists":true,"etag":"\"03817f0652c967e9a963d9b29a1152c1\"","last_modified":"2026-11-04T22:15:04.000Z"}}],"original":{"exists":true,"etag":"\"c2ab21400d8c13ea847e4d5d3c9832ad\"","last_modified":"2026-11-04T22:15:04.000Z"},"events":[{"job_id":"da217f72-cc86-4621-a595-633821709c6a","event":"created","attempt":1,"detail":{},"created_at":"2026-11-04T22:14:18.736Z"},{"job_id":"da217f72-cc86-4621-a595-633821709c6a","event":"claimed","attempt":1,"detail":{"lease_owner":"11fa090ed849"},"created_at":"2026-11-04T22:15:04.465Z"},{"job_id":"da217f72-cc86-4621-a595-633821709c6a","event":"succeeded","attempt":1,"detail":{},"created_at":"2026-11-04T22:15:04.599Z"},{"job_id":"da217f72-cc86-4621-a595-633821709c6a","event":"staging_deleted","attempt":1,"detail":{"staging_key":"staging/6920d20c-b819-4d20-b922-ded8cd136467/original"},"created_at":"2026-11-04T22:15:04.615Z"}],"outbox":{"pending":0,"published":1}}
|
||||
@@ -0,0 +1,41 @@
|
||||
# lab5 — сводка доказательств
|
||||
|
||||
Дата прогона: 2026-11-05. Хост: 8 vCPU i7-11370H, 15 GiB RAM; Docker 29.9.2,
|
||||
Node 25.7.0, Python 3.14.8. Все команды выполнены из корня репозитория; секреты
|
||||
и токены не печатались.
|
||||
|
||||
| Критерий | Файл | Наблюдение |
|
||||
| --- | --- | --- |
|
||||
| Offline-структура и OpenAPI | `make-check.txt` | `PASS: offline skeleton structure` |
|
||||
| Публичный smoke (уровень 3) | `make-test.txt` | `PASS: lab5 public API scenario`; 202 → ready → thumbnail 256×160 JPEG |
|
||||
| Юнит-тесты | `unit-tests.txt` | 18 файлов, 69 тестов, все зелёные; включены fit-inside, backoff, job-message, classifyError, pipelines (EXIF, alpha, determinism) |
|
||||
| E2E приложения | `make-test-e2e.txt` | 44 passed, 9 skipped (opt-in dependency сценарии) |
|
||||
| Отказы зависимостей | `make-test-dependencies.txt` | 7/7: Redis, PostgreSQL, per-replica DB path, насыщение пула, S3 stop/pause, staging при PG down |
|
||||
| Сохранность после рестарта stores | `persistence.txt` | `PASS: persistence preserved confirmed data and existing session` |
|
||||
| Failover API-реплики | `failover.txt` | 124 успешных записи, 0 ошибок, первое восстановление 3.474 s, 2 инстанса до отказа |
|
||||
| Демонстрация «worker остановлен» | `worker-down-demo.txt` | 202 queued, content 409, сообщение привязано, очередь пережила restart broker+API, после start worker — ready и thumbnail 256×160 |
|
||||
| Уровень 4, fault injection | `faults-level4.json`, `faults-level4.txt` | 7/7 сценариев, все I1–I6; crash COMMIT→publish, retry/replay, timeout, DLQ, big image |
|
||||
| Трек 2, 3 повтора | `track2.json`, `track2.txt` | 21/21 (7 сценариев × 3), все I1–I6; duplicate, reorder, crash до/после side effect, crash после COMMIT до ack, relay crash, stale version |
|
||||
| Память worker на 40 Мп | `big-image-memory.txt` | 2 × 8000×5000 одновременно; пик 577–966 MiB (замеры разных прогонов) при лимите 1280 MiB; `OOMKilled=false` |
|
||||
| Состав стенда | `compose-ps.txt` | api ×2 healthy, worker healthy, broker healthy, postgres/redis/s3 healthy |
|
||||
| Очереди и job после demo | `queues.txt` | process 0/1 consumer, DLQ 10 (накопленные poison-сообщения); job succeeded attempt 1, `staging_present=false` |
|
||||
|
||||
## Параметры fault-стенда
|
||||
|
||||
```sh
|
||||
FAULT_INJECTION_ENABLED=1 JOB_TIMEOUT_SECONDS=10 JOB_LEASE_SECONDS=8 \
|
||||
JOB_RETRY_BASE_MS=500 JOB_RETRY_MAX_MS=4000 make stand-up
|
||||
```
|
||||
|
||||
`WORKER_CONCURRENCY=2`, `JOB_MAX_ATTEMPTS=5`, `WORKER_MEMORY=1280m`.
|
||||
После экспериментов стенд возвращён в штатный режим
|
||||
(`FAULT_INJECTION_ENABLED=0`, timeout 60 s, lease 30 s) и `make test` повторён.
|
||||
|
||||
## Итог трека 2
|
||||
|
||||
`track2.json`: 21 запуск, 21 passed. Средние длительности: duplicate 16.7 s,
|
||||
reorder 36.7 s, crash_before 42.1 s, crash_after 43.9 s, crash_after_ack
|
||||
33.2 s, relay_crash 42.1 s, stale_version 48.8 s. Ни один инвариант I1–I6 не
|
||||
нарушен. Повторные публикации и redelivery наблюдались и поглощались
|
||||
(`duplicate_skipped`), S3 etag вариантов не менялся; v1 после v2 получил
|
||||
`superseded`, а v2-объекты остались нетронутыми.
|
||||
@@ -0,0 +1,425 @@
|
||||
[
|
||||
{
|
||||
"name": "duplicate",
|
||||
"repeat": 1,
|
||||
"passed": true,
|
||||
"duration_s": 16.515,
|
||||
"attachment_id": "74730f7b-2803-4da3-a430-7097dbe6a799",
|
||||
"job_attempts": [
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "5 duplicate deliveries were absorbed by the DB fence"
|
||||
},
|
||||
{
|
||||
"name": "duplicate",
|
||||
"repeat": 2,
|
||||
"passed": true,
|
||||
"duration_s": 16.938,
|
||||
"attachment_id": "26d8ab29-e056-4ea0-ab45-2861539515bd",
|
||||
"job_attempts": [
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "5 duplicate deliveries were absorbed by the DB fence"
|
||||
},
|
||||
{
|
||||
"name": "duplicate",
|
||||
"repeat": 3,
|
||||
"passed": true,
|
||||
"duration_s": 16.652,
|
||||
"attachment_id": "f6d5afa2-5e36-4444-8e64-b13c4da41d20",
|
||||
"job_attempts": [
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "5 duplicate deliveries were absorbed by the DB fence"
|
||||
},
|
||||
{
|
||||
"name": "reorder",
|
||||
"repeat": 1,
|
||||
"passed": true,
|
||||
"duration_s": 37.233,
|
||||
"attachment_id": "420cc224-9dcd-4e92-90c3-126d83aaf640",
|
||||
"job_attempts": [
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "attempt 99 and a duplicate attempt 1 were acked as skips"
|
||||
},
|
||||
{
|
||||
"name": "reorder",
|
||||
"repeat": 2,
|
||||
"passed": true,
|
||||
"duration_s": 36.546,
|
||||
"attachment_id": "4dbea2c4-534b-475b-952c-4d1af3e1b9fd",
|
||||
"job_attempts": [
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "attempt 99 and a duplicate attempt 1 were acked as skips"
|
||||
},
|
||||
{
|
||||
"name": "reorder",
|
||||
"repeat": 3,
|
||||
"passed": true,
|
||||
"duration_s": 36.47,
|
||||
"attachment_id": "3d56f2f1-a09a-48aa-b605-ab5a69c882e8",
|
||||
"job_attempts": [
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "attempt 99 and a duplicate attempt 1 were acked as skips"
|
||||
},
|
||||
{
|
||||
"name": "crash_before_side_effect",
|
||||
"repeat": 1,
|
||||
"passed": true,
|
||||
"duration_s": 40.677,
|
||||
"attachment_id": "9d85c5fa-4da8-47ba-a986-1c39b49a27a1",
|
||||
"job_attempts": [
|
||||
2
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "crashed at worker.before_side_effect"
|
||||
},
|
||||
{
|
||||
"name": "crash_before_side_effect",
|
||||
"repeat": 2,
|
||||
"passed": true,
|
||||
"duration_s": 42.92,
|
||||
"attachment_id": "3d4b7a4a-d1e6-4ced-9f59-70bac8b8dfec",
|
||||
"job_attempts": [
|
||||
2
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "crashed at worker.before_side_effect"
|
||||
},
|
||||
{
|
||||
"name": "crash_before_side_effect",
|
||||
"repeat": 3,
|
||||
"passed": true,
|
||||
"duration_s": 42.797,
|
||||
"attachment_id": "0cda94bc-19b7-454a-8898-2bfd11facb6c",
|
||||
"job_attempts": [
|
||||
2
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "crashed at worker.before_side_effect"
|
||||
},
|
||||
{
|
||||
"name": "crash_after_side_effect",
|
||||
"repeat": 1,
|
||||
"passed": true,
|
||||
"duration_s": 44.231,
|
||||
"attachment_id": "6ade96a3-f2dd-413d-9f0d-ff49fcfcc3bd",
|
||||
"job_attempts": [
|
||||
2
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "crashed at worker.after_side_effect"
|
||||
},
|
||||
{
|
||||
"name": "crash_after_side_effect",
|
||||
"repeat": 2,
|
||||
"passed": true,
|
||||
"duration_s": 43.819,
|
||||
"attachment_id": "08ed488b-28a9-4971-845d-05a8744546fd",
|
||||
"job_attempts": [
|
||||
2
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "crashed at worker.after_side_effect"
|
||||
},
|
||||
{
|
||||
"name": "crash_after_side_effect",
|
||||
"repeat": 3,
|
||||
"passed": true,
|
||||
"duration_s": 43.639,
|
||||
"attachment_id": "d870e2b8-d11b-47b4-b200-545f731fccaf",
|
||||
"job_attempts": [
|
||||
2
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "crashed at worker.after_side_effect"
|
||||
},
|
||||
{
|
||||
"name": "crash_after_commit_before_ack",
|
||||
"repeat": 1,
|
||||
"passed": true,
|
||||
"duration_s": 32.458,
|
||||
"attachment_id": "667b757b-3e78-4e61-8326-50d2fe206932",
|
||||
"job_attempts": [
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "crashed at worker.after_commit_before_ack"
|
||||
},
|
||||
{
|
||||
"name": "crash_after_commit_before_ack",
|
||||
"repeat": 2,
|
||||
"passed": true,
|
||||
"duration_s": 32.862,
|
||||
"attachment_id": "f51e94d4-da83-45cf-b252-fe06409a70a8",
|
||||
"job_attempts": [
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "crashed at worker.after_commit_before_ack"
|
||||
},
|
||||
{
|
||||
"name": "crash_after_commit_before_ack",
|
||||
"repeat": 3,
|
||||
"passed": true,
|
||||
"duration_s": 34.177,
|
||||
"attachment_id": "fda75d45-b9dc-4a66-9901-081283d77fa3",
|
||||
"job_attempts": [
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "crashed at worker.after_commit_before_ack"
|
||||
},
|
||||
{
|
||||
"name": "relay_crash_after_publish",
|
||||
"repeat": 1,
|
||||
"passed": true,
|
||||
"duration_s": 42.734,
|
||||
"attachment_id": "004d345c-47cb-4905-96f1-48ebe6a36b9a",
|
||||
"job_attempts": [
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "relay republished the same message; duplicate absorbed"
|
||||
},
|
||||
{
|
||||
"name": "relay_crash_after_publish",
|
||||
"repeat": 2,
|
||||
"passed": true,
|
||||
"duration_s": 40.802,
|
||||
"attachment_id": "5a0a97ec-d0d4-4015-ac96-99fe1346cee4",
|
||||
"job_attempts": [
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "relay republished the same message; duplicate absorbed"
|
||||
},
|
||||
{
|
||||
"name": "relay_crash_after_publish",
|
||||
"repeat": 3,
|
||||
"passed": true,
|
||||
"duration_s": 42.804,
|
||||
"attachment_id": "8ee159d6-786f-434d-be02-4ec0cedfb898",
|
||||
"job_attempts": [
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "relay republished the same message; duplicate absorbed"
|
||||
},
|
||||
{
|
||||
"name": "stale_version",
|
||||
"repeat": 1,
|
||||
"passed": true,
|
||||
"duration_s": 49.303,
|
||||
"attachment_id": "c4be0676-10b0-4249-881e-2d28eaed812f",
|
||||
"job_attempts": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "v1 finished after v2 and was recorded as superseded"
|
||||
},
|
||||
{
|
||||
"name": "stale_version",
|
||||
"repeat": 2,
|
||||
"passed": true,
|
||||
"duration_s": 48.162,
|
||||
"attachment_id": "76a942c6-fc00-4fc7-a94c-72a5c1298022",
|
||||
"job_attempts": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "v1 finished after v2 and was recorded as superseded"
|
||||
},
|
||||
{
|
||||
"name": "stale_version",
|
||||
"repeat": 3,
|
||||
"passed": true,
|
||||
"duration_s": 48.812,
|
||||
"attachment_id": "3c2675b5-f301-4b80-8448-c4fa7067d082",
|
||||
"job_attempts": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"events_summary": {},
|
||||
"invariants": {
|
||||
"I1": true,
|
||||
"I2": true,
|
||||
"I3": true,
|
||||
"I4": true,
|
||||
"I5": true,
|
||||
"I6": true
|
||||
},
|
||||
"notes": "v1 finished after v2 and was recorded as superseded"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,22 @@
|
||||
track2: 21/21 scenarios passed
|
||||
PASS duplicate #1 16.515s I1=true I2=true I3=true I4=true I5=true I6=true 5 duplicate deliveries were absorbed by the DB fence
|
||||
PASS duplicate #2 16.938s I1=true I2=true I3=true I4=true I5=true I6=true 5 duplicate deliveries were absorbed by the DB fence
|
||||
PASS duplicate #3 16.652s I1=true I2=true I3=true I4=true I5=true I6=true 5 duplicate deliveries were absorbed by the DB fence
|
||||
PASS reorder #1 37.233s I1=true I2=true I3=true I4=true I5=true I6=true attempt 99 and a duplicate attempt 1 were acked as skips
|
||||
PASS reorder #2 36.546s I1=true I2=true I3=true I4=true I5=true I6=true attempt 99 and a duplicate attempt 1 were acked as skips
|
||||
PASS reorder #3 36.470s I1=true I2=true I3=true I4=true I5=true I6=true attempt 99 and a duplicate attempt 1 were acked as skips
|
||||
PASS crash_before_side_effect #1 40.677s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.before_side_effect
|
||||
PASS crash_before_side_effect #2 42.920s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.before_side_effect
|
||||
PASS crash_before_side_effect #3 42.797s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.before_side_effect
|
||||
PASS crash_after_side_effect #1 44.231s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_side_effect
|
||||
PASS crash_after_side_effect #2 43.819s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_side_effect
|
||||
PASS crash_after_side_effect #3 43.639s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_side_effect
|
||||
PASS crash_after_commit_before_ack #1 32.458s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_commit_before_ack
|
||||
PASS crash_after_commit_before_ack #2 32.862s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_commit_before_ack
|
||||
PASS crash_after_commit_before_ack #3 34.177s I1=true I2=true I3=true I4=true I5=true I6=true crashed at worker.after_commit_before_ack
|
||||
PASS relay_crash_after_publish #1 42.734s I1=true I2=true I3=true I4=true I5=true I6=true relay republished the same message; duplicate absorbed
|
||||
PASS relay_crash_after_publish #2 40.802s I1=true I2=true I3=true I4=true I5=true I6=true relay republished the same message; duplicate absorbed
|
||||
PASS relay_crash_after_publish #3 42.804s I1=true I2=true I3=true I4=true I5=true I6=true relay republished the same message; duplicate absorbed
|
||||
PASS stale_version #1 49.303s I1=true I2=true I3=true I4=true I5=true I6=true v1 finished after v2 and was recorded as superseded
|
||||
PASS stale_version #2 48.162s I1=true I2=true I3=true I4=true I5=true I6=true v1 finished after v2 and was recorded as superseded
|
||||
PASS stale_version #3 48.812s I1=true I2=true I3=true I4=true I5=true I6=true v1 finished after v2 and was recorded as superseded
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
> app@0.0.1 test:unit
|
||||
> vitest run src/
|
||||
|
||||
The plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the resolve.tsconfigPaths option. You can remove the plugin and set resolve.tsconfigPaths: true in your Vite config instead.
|
||||
|
||||
RUN v4.1.11 /home/tomato/Projects/VP/mtusi2026lab5/app
|
||||
|
||||
[Nest] 1482602 - 11/05/2026, 1:17:43 AM WARN [MessagesCacheService] Cache read failed, serving PostgreSQL: redis down
|
||||
[Nest] 1482602 - 11/05/2026, 1:17:43 AM WARN [MessagesCacheService] Cache fill failed: redis down
|
||||
[Nest] 1482996 - 11/05/2026, 1:17:50 AM WARN [AttachmentsService] Compensation of attachment e7f89989-b925-4ffb-ae59-9e26e897b963 deferred: Connection terminated unexpectedly
|
||||
|
||||
Test Files 18 passed (18)
|
||||
Tests 69 passed (69)
|
||||
Start at 01:17:39
|
||||
Duration 10.17s (transform 3.18s, setup 0ms, import 32.82s, tests 7.20s, environment 3ms)
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
python3 scripts/lab5/worker_down_demo.py --base-url "http://localhost:8080"
|
||||
[1] compose ps
|
||||
SERVICE STATUS
|
||||
api Up 50 seconds (healthy)
|
||||
api Up 4 seconds (health: starting)
|
||||
broker Up 53 seconds (healthy)
|
||||
haproxy Up 54 seconds
|
||||
postgres Up 54 seconds (healthy)
|
||||
redis Up 54 seconds (healthy)
|
||||
s3 Up 54 seconds (healthy)
|
||||
worker Up 54 seconds (healthy)
|
||||
[2] stop worker
|
||||
[3] upload while worker is down (expect 202 queued)
|
||||
attachment=6920d20c-b819-4d20-b922-ded8cd136467 status=queued
|
||||
[4] content and thumbnail must answer 409 before ready
|
||||
[5] link the queued attachment to messages
|
||||
message=7b4ec662-3361-4210-b62c-da913537d21e
|
||||
[6] wait for outbox publish and a message in the queue
|
||||
queue={'messages': 1, 'type': 'quorum'}
|
||||
[7] restart broker and API with volumes
|
||||
[8] the quorum message survived the broker restart
|
||||
queue={'messages': 1, 'type': 'quorum'}
|
||||
[9] start worker
|
||||
[10] wait ready and verify the thumbnail
|
||||
ready attachment=6920d20c-b819-4d20-b922-ded8cd136467 thumbnail=256x160 sha256=a18bfc29cd931180...
|
||||
[11] compose ps
|
||||
SERVICE STATUS
|
||||
api Up 33 seconds (healthy)
|
||||
api Up 33 seconds (healthy)
|
||||
broker Up 35 seconds (healthy)
|
||||
haproxy Up About a minute
|
||||
postgres Up About a minute (healthy)
|
||||
redis Up About a minute (healthy)
|
||||
s3 Up About a minute (healthy)
|
||||
worker Up 2 seconds (health: starting)
|
||||
PASS: worker-down durability demo
|
||||
Reference in New Issue
Block a user