forked from mtusi2026/mtusi2026lab5
Приложил результаты проверок и написал отчёт
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
# 2026-11-05T21:56:06Z $ python3 tests/attachments.py
|
||||
PASS: attachment validation, limits and access control
|
||||
# exit=0
|
||||
@@ -0,0 +1,8 @@
|
||||
# 2026-11-05T21:57:18Z $ make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 139, "failed_attempts": 1, "first_recovery_seconds": 3.475}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
# exit=0
|
||||
# api containers after hook
|
||||
mtusi2026lab5-fork-api-1 Exited (0) 12 seconds ago
|
||||
mtusi2026lab5-fork-api-2 Up 35 seconds (healthy)
|
||||
@@ -0,0 +1,7 @@
|
||||
# 2026-11-05T22:01:19Z $ make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 140, "failed_attempts": 0, "first_recovery_seconds": 3.465}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
# api containers after hook
|
||||
mtusi2026lab5-fork-api-1 Up 35 seconds (healthy)
|
||||
mtusi2026lab5-fork-api-2 Exited (0) 12 seconds ago
|
||||
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"baseline": {
|
||||
"window_seconds": 6,
|
||||
"successful_requests": 3146,
|
||||
"failed_attempts": 0,
|
||||
"successful_rps": 524.3,
|
||||
"last_error_offset_seconds": null,
|
||||
"instances": [
|
||||
"4337e4656268",
|
||||
"eb2165af370d"
|
||||
]
|
||||
},
|
||||
"replicas": [
|
||||
{
|
||||
"stopped_replica": "eb2165af370d",
|
||||
"during_failure": {
|
||||
"window_seconds": 15.35,
|
||||
"successful_requests": 6738,
|
||||
"failed_attempts": 2,
|
||||
"successful_rps": 438.9,
|
||||
"last_error_offset_seconds": 0.66,
|
||||
"instances": [
|
||||
"4337e4656268",
|
||||
"eb2165af370d"
|
||||
]
|
||||
},
|
||||
"seen_stopped_replica_after_stop": false,
|
||||
"stop_command_seconds": 3.35,
|
||||
"restore_seconds": 6.48,
|
||||
"after_restore": {
|
||||
"window_seconds": 7.0,
|
||||
"successful_requests": 3915,
|
||||
"failed_attempts": 0,
|
||||
"successful_rps": 559.3,
|
||||
"last_error_offset_seconds": null,
|
||||
"instances": [
|
||||
"4337e4656268",
|
||||
"eb2165af370d"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"stopped_replica": "4337e4656268",
|
||||
"during_failure": {
|
||||
"window_seconds": 15.5,
|
||||
"successful_requests": 6926,
|
||||
"failed_attempts": 0,
|
||||
"successful_rps": 446.9,
|
||||
"last_error_offset_seconds": null,
|
||||
"instances": [
|
||||
"4337e4656268",
|
||||
"eb2165af370d"
|
||||
]
|
||||
},
|
||||
"seen_stopped_replica_after_stop": false,
|
||||
"stop_command_seconds": 3.5,
|
||||
"restore_seconds": 6.52,
|
||||
"after_restore": {
|
||||
"window_seconds": 7.0,
|
||||
"successful_requests": 3608,
|
||||
"failed_attempts": 0,
|
||||
"successful_rps": 515.4,
|
||||
"last_error_offset_seconds": null,
|
||||
"instances": [
|
||||
"4337e4656268",
|
||||
"eb2165af370d"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# 2026-11-05T22:02:15Z $ python3 tests/faults.py
|
||||
1) api crashed after COMMIT before 202/publish: attachment=50f6ace7-1393-4c19-b47a-1def389a62c3 recovered by outbox relay (published rows=1) -> ready attempt=1
|
||||
2) worker crashed after S3 write before COMMIT: lease expired, reaper requeued, attempt=2 ready, variants=3
|
||||
3) worker crashed after COMMIT before ack: message redelivered after restart, skipped as no-op, attempt=1, variants=3
|
||||
4) s3 down: transient errors retried with backoff+jitter delays_ms=[931, 1284, 2760, 7484], then failed retry_exhausted, listed in registry
|
||||
replay: failed -> queued -> ready (audit rows=1); replay of ready job skipped, variants=3
|
||||
5) corrupted IDAT (passes header/tail check in API): failed invalid_image on attempt 1, no retries
|
||||
PASS: outbox recovery, lease recovery, redelivery after commit, backoff with jitter, retry_exhausted, replay, permanent error
|
||||
# exit=0
|
||||
@@ -0,0 +1,3 @@
|
||||
# 2026-11-05T21:56:12Z $ python3 tests/idempotency.py
|
||||
PASS: 32 parallel requests, 1 message, 2 instances
|
||||
# exit=0
|
||||
@@ -0,0 +1,25 @@
|
||||
# before
|
||||
api Up 2 minutes (healthy)
|
||||
api Up 2 minutes (healthy)
|
||||
broker Up 16 minutes (healthy)
|
||||
janitor Up 2 minutes
|
||||
lb Up 12 minutes
|
||||
postgres Up 19 minutes (healthy)
|
||||
s3 Up 7 minutes (healthy)
|
||||
valkey Up 19 minutes (healthy)
|
||||
worker Up 37 seconds
|
||||
# 2026-11-05T21:56:14Z $ make test-persistence ACTION_SCRIPT=scripts/restart.sh
|
||||
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.
|
||||
# exit=0
|
||||
# after
|
||||
api Up 2 seconds (health: starting)
|
||||
api Up 2 seconds (health: starting)
|
||||
broker Up 46 seconds (healthy)
|
||||
janitor Up 5 seconds
|
||||
lb Up 5 seconds
|
||||
postgres Up 46 seconds (healthy)
|
||||
s3 Up 36 seconds (healthy)
|
||||
valkey Up 46 seconds (healthy)
|
||||
worker Up Less than a second
|
||||
@@ -0,0 +1,7 @@
|
||||
# 2026-11-05T22:01:54Z $ python3 tests/queue_recovery.py
|
||||
accepted: attachment=d4c108ad-3da8-467c-aee0-eb2ee25759fc job=0208b98f-c201-4686-aa66-62b0bbf703ae status=queued, job in stream, worker stopped
|
||||
restarted broker and api: job still in stream, attachment still queued
|
||||
worker started: attachment ready, attempt=1, variants=3
|
||||
duplicate delivery: skipped as no-op, acked, variants=3, updated_at unchanged
|
||||
PASS: worker stop, broker/api restart, redelivery idempotency
|
||||
# exit=0
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"old_replicas": [
|
||||
"eb2165af370d",
|
||||
"4337e4656268"
|
||||
],
|
||||
"new_replicas": [
|
||||
"2ce132adb5c9",
|
||||
"2fe5ec734588"
|
||||
],
|
||||
"update_window": {
|
||||
"window_seconds": 16.4,
|
||||
"successful_requests": 10091,
|
||||
"failed_attempts": 4,
|
||||
"successful_rps": 615.4,
|
||||
"last_error_offset_seconds": 13.57,
|
||||
"instances": [
|
||||
"2ce132adb5c9",
|
||||
"2fe5ec734588",
|
||||
"4337e4656268",
|
||||
"eb2165af370d"
|
||||
]
|
||||
},
|
||||
"old_replicas_served_after_update": []
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
# 2026-11-05T22:04:42Z $ python3 tests/s3_checks.py
|
||||
PASS: private bucket, limited credentials, s3 outage, orphan and staging cleanup
|
||||
# exit=0
|
||||
@@ -0,0 +1,6 @@
|
||||
# 2026-11-05T21:56:01Z $ sh -c make check && make test
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
python3 tests/smoke.py --base-url "http://localhost:8080"
|
||||
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
|
||||
# exit=0
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"file_bytes": 9722608,
|
||||
"concurrent_uploads": 12,
|
||||
"rounds": 3,
|
||||
"uploads_ok": 36,
|
||||
"uploads_failed": 0,
|
||||
"elapsed_seconds": 12.65,
|
||||
"api_memory_limit_mib": 192,
|
||||
"idle_memory_mib": {
|
||||
"mtusi2026lab5-fork-api-1": 62.4,
|
||||
"mtusi2026lab5-fork-api-2": 62.2
|
||||
},
|
||||
"peak_memory_mib": {
|
||||
"mtusi2026lab5-fork-api-1": 118.8,
|
||||
"mtusi2026lab5-fork-api-2": 99.5
|
||||
},
|
||||
"buffering_all_files_would_need_mib": 111.3
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
# 2026-11-05T21:56:02Z $ python3 tests/variants.py
|
||||
PASS: thumbnail/crop/optimized sizes, formats, checksums, no upscale, alpha on white, EXIF orientation, no EXIF in variants
|
||||
# exit=0
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"huge_images": {
|
||||
"count": 6,
|
||||
"pixels": 39942400,
|
||||
"bytes": 116545
|
||||
},
|
||||
"small_images": 20,
|
||||
"worker_concurrency": 2,
|
||||
"max_processing_jobs_observed": 2,
|
||||
"all_ready": true,
|
||||
"accept_seconds": 0.32,
|
||||
"all_ready_seconds": 13.1,
|
||||
"worker_peak_rss_mib": 616.7,
|
||||
"worker_memory_limit_mib": 768,
|
||||
"worker_restarts_oom": [
|
||||
"0",
|
||||
"false"
|
||||
],
|
||||
"timeout_case": {
|
||||
"job_timeout_seconds": 1,
|
||||
"status": "failed",
|
||||
"error_code": "retry_exhausted",
|
||||
"attempts": 5,
|
||||
"last_error": "context deadline exceeded"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user