included rabbitmq as broker

This commit is contained in:
2026-11-10 07:01:17 +03:00
parent 0a70358829
commit 2b9fb3f375
49 changed files with 3072 additions and 287 deletions
+378
View File
@@ -0,0 +1,378 @@
{
"status": "passed",
"results": [
{
"scenario": "worker_stopped_restart_all",
"attachment_id": "96d4fc78-4e72-473c-a2a9-57db94421707",
"queue_before": {
"name": "attachment-jobs",
"messages_unacknowledged": 0,
"consumers": 0,
"durable": true,
"messages_ready": 1
},
"queue_after": {
"name": "attachment-jobs",
"messages_unacknowledged": 0,
"consumers": 0,
"durable": true,
"messages_ready": 1
},
"after": {
"job_id": "b3a81ec6-65d6-4201-aeb9-fedbe92fdaaf",
"status": "ready",
"attempt": 1,
"published_attempt": 1,
"limit": 5,
"updated_at": "2026-11-10 03:27:44.556734+00:00",
"next_attempt_at": "2026-11-10 03:26:56.662360+00:00",
"last_error_code": null,
"permanent": null,
"objects": [
{
"name": "crop.jpg",
"size": 2462,
"sha256": "fae35500205a78065cf7d589f121cc909b017e2a4cde882177e24f5608fb4c1f",
"last_modified": "2026-11-10 03:27:44.548000+00:00"
},
{
"name": "optimized.webp",
"size": 2462,
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
"last_modified": "2026-11-10 03:27:44.552000+00:00"
},
{
"name": "thumbnail.jpg",
"size": 5813,
"sha256": "b8e59b0cad429b1c49c27c4a1c79e52bfc23e2fab7c7238d18d5addd4df4b546",
"last_modified": "2026-11-10 03:27:44.543000+00:00"
},
{
"name": "v1",
"size": 111817,
"sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
"last_modified": "2026-11-10 03:27:44.536000+00:00"
}
]
}
},
{
"scenario": "crash-after-object",
"attachment_id": "115c5e05-3d09-4f04-9b32-0d27597b65fc",
"exit_code": 137,
"before": {
"job_id": "ba3dc221-5651-4c1d-8bfd-9fd61c8aa854",
"status": "processing",
"attempt": 1,
"published_attempt": 1,
"limit": 5,
"updated_at": "2026-11-10 03:27:49.144648+00:00",
"next_attempt_at": "2026-11-10 03:27:47.218612+00:00",
"last_error_code": null,
"permanent": null,
"objects": [
{
"name": "crop.jpg",
"size": 2462,
"sha256": "fae35500205a78065cf7d589f121cc909b017e2a4cde882177e24f5608fb4c1f",
"last_modified": "2026-11-10 03:27:49.912000+00:00"
},
{
"name": "optimized.webp",
"size": 2462,
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
"last_modified": "2026-11-10 03:27:49.917000+00:00"
},
{
"name": "thumbnail.jpg",
"size": 5813,
"sha256": "b8e59b0cad429b1c49c27c4a1c79e52bfc23e2fab7c7238d18d5addd4df4b546",
"last_modified": "2026-11-10 03:27:49.907000+00:00"
},
{
"name": "v1",
"size": 111817,
"sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
"last_modified": "2026-11-10 03:27:49.894000+00:00"
}
]
},
"after": {
"job_id": "ba3dc221-5651-4c1d-8bfd-9fd61c8aa854",
"status": "ready",
"attempt": 2,
"published_attempt": 2,
"limit": 5,
"updated_at": "2026-11-10 03:29:24.765539+00:00",
"next_attempt_at": "2026-11-10 03:29:23.142176+00:00",
"last_error_code": null,
"permanent": null,
"objects": [
{
"name": "crop.jpg",
"size": 2462,
"sha256": "fae35500205a78065cf7d589f121cc909b017e2a4cde882177e24f5608fb4c1f",
"last_modified": "2026-11-10 03:29:24.750000+00:00"
},
{
"name": "optimized.webp",
"size": 2462,
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
"last_modified": "2026-11-10 03:29:24.758000+00:00"
},
{
"name": "thumbnail.jpg",
"size": 5813,
"sha256": "b8e59b0cad429b1c49c27c4a1c79e52bfc23e2fab7c7238d18d5addd4df4b546",
"last_modified": "2026-11-10 03:29:24.742000+00:00"
},
{
"name": "v1",
"size": 111817,
"sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
"last_modified": "2026-11-10 03:29:24.725000+00:00"
}
]
}
},
{
"scenario": "crash-before-ack",
"attachment_id": "2f97fc61-fc07-47da-98a8-9d9894ed4cd1",
"exit_code": 137,
"before": {
"job_id": "4a0bc78c-d79a-4e1a-88f7-11ad03045135",
"status": "ready",
"attempt": 1,
"published_attempt": 1,
"limit": 5,
"updated_at": "2026-11-10 03:29:29.833142+00:00",
"next_attempt_at": "2026-11-10 03:29:27.262932+00:00",
"last_error_code": null,
"permanent": null,
"objects": [
{
"name": "crop.jpg",
"size": 2462,
"sha256": "fae35500205a78065cf7d589f121cc909b017e2a4cde882177e24f5608fb4c1f",
"last_modified": "2026-11-10 03:29:29.824000+00:00"
},
{
"name": "optimized.webp",
"size": 2462,
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
"last_modified": "2026-11-10 03:29:29.829000+00:00"
},
{
"name": "thumbnail.jpg",
"size": 5813,
"sha256": "b8e59b0cad429b1c49c27c4a1c79e52bfc23e2fab7c7238d18d5addd4df4b546",
"last_modified": "2026-11-10 03:29:29.818000+00:00"
},
{
"name": "v1",
"size": 111817,
"sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
"last_modified": "2026-11-10 03:29:29.805000+00:00"
}
]
},
"after": {
"job_id": "4a0bc78c-d79a-4e1a-88f7-11ad03045135",
"status": "ready",
"attempt": 1,
"published_attempt": 1,
"limit": 5,
"updated_at": "2026-11-10 03:29:29.833142+00:00",
"next_attempt_at": "2026-11-10 03:29:27.262932+00:00",
"last_error_code": null,
"permanent": null,
"objects": [
{
"name": "crop.jpg",
"size": 2462,
"sha256": "fae35500205a78065cf7d589f121cc909b017e2a4cde882177e24f5608fb4c1f",
"last_modified": "2026-11-10 03:29:29.824000+00:00"
},
{
"name": "optimized.webp",
"size": 2462,
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
"last_modified": "2026-11-10 03:29:29.829000+00:00"
},
{
"name": "thumbnail.jpg",
"size": 5813,
"sha256": "b8e59b0cad429b1c49c27c4a1c79e52bfc23e2fab7c7238d18d5addd4df4b546",
"last_modified": "2026-11-10 03:29:29.818000+00:00"
},
{
"name": "v1",
"size": 111817,
"sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
"last_modified": "2026-11-10 03:29:29.805000+00:00"
}
]
}
},
{
"scenario": "fail-transient",
"attachment_id": "92c4de14-53cd-4805-a842-9892a8b7a5ea",
"samples": [
{
"job_id": "f44f6bfa-9fde-4616-b3cf-83dde54b1154",
"status": "queued",
"attempt": 1,
"published_attempt": 1,
"limit": 5,
"updated_at": "2026-11-10 03:29:45.863494+00:00",
"next_attempt_at": "2026-11-10 03:29:50.476742+00:00",
"last_error_code": "processing_timeout",
"permanent": false,
"objects": []
},
{
"job_id": "f44f6bfa-9fde-4616-b3cf-83dde54b1154",
"status": "queued",
"attempt": 2,
"published_attempt": 2,
"limit": 5,
"updated_at": "2026-11-10 03:29:51.216904+00:00",
"next_attempt_at": "2026-11-10 03:29:58.053724+00:00",
"last_error_code": "processing_timeout",
"permanent": false,
"objects": []
},
{
"job_id": "f44f6bfa-9fde-4616-b3cf-83dde54b1154",
"status": "queued",
"attempt": 3,
"published_attempt": 3,
"limit": 5,
"updated_at": "2026-11-10 03:29:58.279470+00:00",
"next_attempt_at": "2026-11-10 03:30:15.602067+00:00",
"last_error_code": "processing_timeout",
"permanent": false,
"objects": []
},
{
"job_id": "f44f6bfa-9fde-4616-b3cf-83dde54b1154",
"status": "queued",
"attempt": 4,
"published_attempt": 4,
"limit": 5,
"updated_at": "2026-11-10 03:30:16.386336+00:00",
"next_attempt_at": "2026-11-10 03:30:47.271081+00:00",
"last_error_code": "processing_timeout",
"permanent": false,
"objects": []
},
{
"job_id": "f44f6bfa-9fde-4616-b3cf-83dde54b1154",
"status": "failed",
"attempt": 5,
"published_attempt": 5,
"limit": 5,
"updated_at": "2026-11-10 03:30:47.622716+00:00",
"next_attempt_at": "2026-11-10 03:31:30.255216+00:00",
"last_error_code": "processing_timeout",
"permanent": false,
"objects": []
}
],
"after": {
"job_id": "f44f6bfa-9fde-4616-b3cf-83dde54b1154",
"status": "ready",
"attempt": 6,
"published_attempt": 6,
"limit": 10,
"updated_at": "2026-11-10 03:30:59.696883+00:00",
"next_attempt_at": "2026-11-10 03:30:53.135190+00:00",
"last_error_code": null,
"permanent": null,
"objects": [
{
"name": "crop.jpg",
"size": 2462,
"sha256": "fae35500205a78065cf7d589f121cc909b017e2a4cde882177e24f5608fb4c1f",
"last_modified": "2026-11-10 03:30:59.687000+00:00"
},
{
"name": "optimized.webp",
"size": 2462,
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
"last_modified": "2026-11-10 03:30:59.692000+00:00"
},
{
"name": "thumbnail.jpg",
"size": 5813,
"sha256": "b8e59b0cad429b1c49c27c4a1c79e52bfc23e2fab7c7238d18d5addd4df4b546",
"last_modified": "2026-11-10 03:30:59.683000+00:00"
},
{
"name": "v1",
"size": 111817,
"sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
"last_modified": "2026-11-10 03:30:59.670000+00:00"
}
]
},
"replay_idempotent": true
},
{
"scenario": "fail-permanent",
"attachment_id": "92e2baff-5b26-4326-bee6-269382ff80c9",
"samples": [
{
"job_id": "f462098d-43b7-41cc-afe8-399aaf3ed0bd",
"status": "failed",
"attempt": 1,
"published_attempt": 1,
"limit": 5,
"updated_at": "2026-11-10 03:31:12.333162+00:00",
"next_attempt_at": "2026-11-10 03:31:16.827024+00:00",
"last_error_code": "injected_permanent",
"permanent": true,
"objects": []
}
],
"after": {
"job_id": "f462098d-43b7-41cc-afe8-399aaf3ed0bd",
"status": "ready",
"attempt": 2,
"published_attempt": 2,
"limit": 6,
"updated_at": "2026-11-10 03:31:24.282794+00:00",
"next_attempt_at": "2026-11-10 03:31:17.137221+00:00",
"last_error_code": null,
"permanent": null,
"objects": [
{
"name": "crop.jpg",
"size": 2462,
"sha256": "fae35500205a78065cf7d589f121cc909b017e2a4cde882177e24f5608fb4c1f",
"last_modified": "2026-11-10 03:31:24.272000+00:00"
},
{
"name": "optimized.webp",
"size": 2462,
"sha256": "1090d84ed8411226010ae498b08e1b9e6d81c8eee02ee77143a0dc327b894beb",
"last_modified": "2026-11-10 03:31:24.278000+00:00"
},
{
"name": "thumbnail.jpg",
"size": 5813,
"sha256": "b8e59b0cad429b1c49c27c4a1c79e52bfc23e2fab7c7238d18d5addd4df4b546",
"last_modified": "2026-11-10 03:31:24.267000+00:00"
},
{
"name": "v1",
"size": 111817,
"sha256": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
"last_modified": "2026-11-10 03:31:24.254000+00:00"
}
]
},
"replay_idempotent": true
}
]
}
+271
View File
@@ -0,0 +1,271 @@
{
"date": "2026-11-10",
"status": "passed",
"project": "mtusi-lab5-verification",
"base_url": "http://localhost:28080",
"checks": [
{
"name": "pytest_regression",
"exit_code": 0,
"stdout": "199 passed in 82.29s (0:01:22)",
"scope": "Dedicated *_test database and Redis DB15; Docker restart tests enabled"
},
{
"name": "pytest_timeout_retention",
"exit_code": 0,
"stdout": "2 passed, 5 deselected in 1.91s",
"scope": "Dedicated *_test database and Redis DB15; Docker restart tests enabled"
},
{
"name": "compose_configuration",
"command": [
"docker",
"compose",
"--env-file",
".env",
"config",
"--quiet"
],
"exit_code": 0,
"stdout": ""
},
{
"name": "contract",
"command": [
"/home/gytall/.pyenv/versions/3.12.14/bin/python3",
"scripts/check_contract.py"
],
"exit_code": 0,
"stdout": "PASS: offline skeleton structure, local refs and Python syntax; application NOT tested."
},
{
"name": "openapi",
"command": [
"/home/gytall/.pyenv/versions/3.12.14/bin/python3",
"scripts/validate_openapi.py"
],
"exit_code": 0,
"stdout": "PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested."
},
{
"name": "public_smoke",
"command": [
"/home/gytall/.pyenv/versions/3.12.14/bin/python3",
"tests/smoke.py",
"--base-url",
"http://localhost:28080"
],
"exit_code": 0,
"stdout": "PASS: lab5 public API scenario; infrastructure and grading evidence remain separate."
},
{
"name": "message_idempotency",
"command": [
"/home/gytall/.pyenv/versions/3.12.14/bin/python3",
"-m",
"scripts.check_idempotency",
"--base-url",
"http://localhost:28080"
],
"exit_code": 0,
"stdout": "PASS: 24 concurrent replays, 2 replicas, one message"
},
{
"name": "outbox_crash",
"command": [
"/home/gytall/.pyenv/versions/3.12.14/bin/python3",
"-m",
"scripts.check_outbox_recovery",
"--base-url",
"http://localhost:28080"
],
"exit_code": 0,
"stdout": "{\"scenario\": \"commit_before_publish\", \"attachment_id\": \"0fff1dce-c479-40d8-8627-f28cc85cb6cf\", \"message_id\": \"e79bfb7e-c2af-4011-a87a-52528d7a7840\", \"publisher_exit_code\": 137, \"status_after_crash\": \"queued\", \"status_after_restart\": \"ready\", \"variants\": [\"thumbnail\", \"crop\", \"optimized\"], \"reuploaded\": false}"
},
{
"name": "public_persistence",
"command": [
"/home/gytall/.pyenv/versions/3.12.14/bin/python3",
"tests/resilience.py",
"--mode",
"persistence",
"--action-script",
"scripts/restart.sh",
"--base-url",
"http://localhost:28080"
],
"exit_code": 0,
"stdout": "Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.\nPASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence."
},
{
"name": "public_failover",
"command": [
"/home/gytall/.pyenv/versions/3.12.14/bin/python3",
"tests/resilience.py",
"--mode",
"failover",
"--action-script",
"scripts/stop-one.sh",
"--base-url",
"http://localhost:28080"
],
"exit_code": 0,
"stdout": "Executing explicit failover hook; hook output suppressed to avoid leaking secrets.\n{\"observed_instances_before\": 2, \"successful_writes\": 104, \"failed_attempts\": 5, \"first_recovery_seconds\": 1.907}\nPASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence."
},
{
"name": "rabbitmq_prefetch",
"command": [
"docker",
"compose",
"--env-file",
".env",
"exec",
"-T",
"broker",
"rabbitmqctl",
"list_channels",
"--formatter=json",
"consumer_count",
"prefetch_count",
"messages_unacknowledged"
],
"exit_code": 0,
"stdout": "[\n{\"consumer_count\":1,\"messages_unacknowledged\":0,\"prefetch_count\":1}\n,{\"consumer_count\":0,\"messages_unacknowledged\":0,\"prefetch_count\":1}\n,{\"consumer_count\":1,\"messages_unacknowledged\":0,\"prefetch_count\":1}\n]"
},
{
"name": "rabbitmq_durability_ack",
"command": [
"docker",
"compose",
"--env-file",
".env",
"exec",
"-T",
"broker",
"rabbitmqctl",
"list_queues",
"--formatter=json",
"name",
"durable",
"messages_ready",
"messages_unacknowledged",
"consumers"
],
"exit_code": 0,
"stdout": "[\n{\"name\":\"attachment-jobs\",\"messages_unacknowledged\":0,\"consumers\":2,\"durable\":true,\"messages_ready\":0}\n]"
},
{
"name": "worker_fault_retry_replay",
"exit_code": 0,
"evidence": "lab5-jobs.json",
"scenarios": [
"worker_stopped_restart_all",
"crash-after-object",
"crash-before-ack",
"fail-transient",
"fail-permanent"
]
},
{
"name": "whitespace",
"command": [
"git",
"diff",
"--check"
],
"exit_code": 0,
"stdout": ""
},
{
"name": "public_contract_tests_unchanged",
"exit_code": 0
},
{
"name": "final_services",
"command": [
"docker",
"compose",
"--env-file",
".env",
"ps",
"--format",
"{{.Service}} {{.State}} {{.Health}}"
],
"exit_code": 0,
"stdout": "api running healthy\napi running healthy\nbroker running healthy\ncleanup running \nminio running healthy\nnginx running healthy\npostgres running healthy\npublisher running \nredis running healthy\nworker running"
}
],
"git_base_commit": "0a703588290e26d0f148b45d0e6bee2e8eefce7d",
"uncommitted_changes": true,
"environment": {
"test_runner_python": "3.12.14",
"runtime_python": "3.12.15",
"broker": "RabbitMQ 4.4.0",
"sessions": "Redis 7.4.2",
"worker_memory_bytes": 2147483648,
"worker_cpu_limit": 2.0,
"worker_init": true
},
"profile": {
"data": "Synthetic users/chats only; tests/fixtures/sample.png for fault scenarios; no credentials in evidence",
"worker_concurrency": 2,
"prefetch_per_consumer": 1,
"max_attempts_per_cycle": 5,
"timeout_seconds": 60,
"lease_seconds": 90,
"retry_base_seconds": 5,
"retry_cap_seconds": 120,
"image_memory_mib": 768,
"image_cpu_seconds": 20,
"isolated_limit_tests": "256 MiB / 1 CPU second in child process; timeout cancellation checked separately"
},
"criteria": {
"3.1_lab4_and_durable_202": [
"pytest_regression",
"public_smoke",
"public_persistence",
"worker_fault_retry_replay"
],
"3.2_durable_broker_worker_late_ack": [
"rabbitmq_durability_ack",
"rabbitmq_prefetch",
"worker_fault_retry_replay"
],
"3.3_states_original_thumbnail": [
"public_smoke",
"pytest_regression",
"worker_fault_retry_replay"
],
"3.4_bounded_retry_idempotency": [
"pytest_regression",
"worker_fault_retry_replay"
],
"3.5_stopped_worker_api_broker_restart": [
"worker_fault_retry_replay",
"public_persistence"
],
"4.1_crop_webp_and_worker_limits": [
"pytest_regression",
"worker_fault_retry_replay"
],
"4.2_commit_publish_recovery": [
"outbox_crash"
],
"4.3_backoff_jitter_classification_registry_replay": [
"pytest_regression",
"pytest_timeout_retention",
"worker_fault_retry_replay"
],
"4.4_crash_after_put_lease_prefetch_cleanup": [
"worker_fault_retry_replay",
"rabbitmq_prefetch",
"pytest_regression",
"pytest_timeout_retention"
]
},
"limitations": [
"Single Docker host, no disk-loss or cluster failover claim",
"Grade 5 experiments not performed",
"No production-scale performance/security claim"
]
}