4.1 KiB
4.1 KiB
Lab 5 grade 4 — результаты проверки
Дата: 2026-11-16, дополнено 2026-11-17. Среда: macOS host, Docker Desktop Linux containers.
Секреты, session tokens и содержимое .env не сохранялись.
$ make check
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
$ docker compose -f compose.tests.yaml run --rm \
-v "$PWD/app:/tests/app:ro" -v "$PWD/tests:/tests/tests:ro" \
tests python -m pytest -q
................... [100%]
19 passed in 1.22s
$ docker compose -f compose.tests.yaml run --rm --no-deps \
-v "$PWD/app:/tests/app:ro" -v "$PWD/tests:/tests/tests:ro" \
tests python -m pytest -q tests/test_pipeline.py
....... [100%]
7 passed in 0.94s
$ docker compose -f compose.tests.yaml run --rm --no-deps \
-v "$PWD/scripts:/tests/scripts:ro" \
tests python scripts/validate_openapi.py
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
$ python3 tests/smoke.py --base-url http://127.0.0.1:18080
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
$ python3 tests/pipeline_smoke.py --base-url http://127.0.0.1:18080
PASS: original plus thumbnail/crop/optimized variants are valid
$ COMPOSE_FILE_PATH=compose.tests.yaml python3 tests/outbox_recovery.py \
--base-url http://127.0.0.1:18080 \
--stop-publisher-script scripts/stop-publisher.sh \
--start-publisher-script scripts/start-publisher.sh
PASS: COMMIT-before-publish recovered without a new upload
$ COMPOSE_FILE_PATH=compose.tests.yaml python3 tests/worker_outage.py \
--base-url http://127.0.0.1:18080 \
--stop-worker-script scripts/stop-worker.sh \
--restart-api-script scripts/restart-api.sh \
--start-worker-script scripts/start-worker.sh
PASS: worker stopped -> 202 -> message -> API restart -> worker -> ready
$ COMPOSE_FILE_PATH=compose.tests.yaml python3 tests/broker_persistence.py \
--base-url http://127.0.0.1:18080 \
--stop-worker-script scripts/stop-worker.sh \
--restart-broker-script scripts/restart-broker.sh \
--start-worker-script scripts/start-worker.sh
PASS: confirmed durable message survived broker restart with its volume
$ COMPOSE_FILE_PATH=compose.tests.yaml python3 tests/publisher_confirm_crash.py \
--base-url http://127.0.0.1:18080 \
--stop-publisher-script scripts/stop-publisher.sh \
--crash-publisher-script scripts/crash-publisher-after-confirm.sh
PASS: confirm-before-outbox-mark duplicate produced one logical result
$ COMPOSE_FILE_PATH=compose.tests.yaml python3 tests/worker_crash.py \
--base-url http://127.0.0.1:18080 \
--stop-worker-script scripts/stop-worker.sh \
--crash-worker-script scripts/crash-worker.sh \
--mode objects
PASS: worker crash mode=objects recovered one logical result
$ COMPOSE_FILE_PATH=compose.tests.yaml python3 tests/worker_crash.py \
--base-url http://127.0.0.1:18080 \
--stop-worker-script scripts/stop-worker.sh \
--crash-worker-script scripts/crash-worker.sh \
--mode commit
PASS: worker crash mode=commit recovered one logical result
$ COMPOSE_FILE_PATH=compose.tests.yaml python3 tests/failed_replay.py \
--base-url http://127.0.0.1:18080 \
--stop-worker-script scripts/stop-worker.sh \
--crash-worker-script scripts/crash-worker.sh \
--replay-script scripts/replay-attachment.sh
REPLAYED job_id=c9e77317-0803-4a23-bfa6-ab1113e47ed3
REJECTED job_id=c9e77317-0803-4a23-bfa6-ab1113e47ed3 reason=not_failed_or_staging_missing
PASS: permanent failure reached failed/DLQ and guarded replay reached ready
$ docker compose -f compose.tests.yaml exec -T broker rabbitmqctl list_queues name messages messages_ready
attachments.process 0 0
attachments.failed 1 1
$ git diff --check
(no output, exit 0)
Fault scripts управляют реальными Compose services (api, publisher, worker,
broker) и не создают новую attachment/job для восстановления уже принятой работы.
В тесте lease используется 3 секунды для быстрого воспроизведения; штатное значение —
90 секунд.