This commit is contained in:
2026-11-12 17:28:28 +03:00
parent 276dbdad8a
commit 4fae7d7e87
103 changed files with 10742 additions and 54 deletions
+2
View File
@@ -0,0 +1,2 @@
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
+4
View File
@@ -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": 133, "failed_attempts": 0, "first_recovery_seconds": 5.006}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
+17
View File
@@ -0,0 +1,17 @@
? mtusi2026/cmd/api [no test files]
? mtusi2026/cmd/reconcile [no test files]
? mtusi2026/cmd/worker [no test files]
? mtusi2026/internal/auth [no test files]
? mtusi2026/internal/blobstore [no test files]
? mtusi2026/internal/cache [no test files]
? mtusi2026/internal/config [no test files]
? mtusi2026/internal/cursor [no test files]
? mtusi2026/internal/db [no test files]
ok mtusi2026/internal/httpapi 23.902s
? mtusi2026/internal/idgen [no test files]
ok mtusi2026/internal/images (cached)
ok mtusi2026/internal/jobs (cached)
? mtusi2026/internal/model [no test files]
? mtusi2026/internal/reconcile [no test files]
? mtusi2026/internal/sessionstore [no test files]
? mtusi2026/internal/store [no test files]
View File
+46
View File
@@ -0,0 +1,46 @@
{
"mtusi2026lab5-api-1": {
"cpu_peak_percent": 35.7,
"memory_sample": "178MiB / 512MiB"
},
"mtusi2026lab5-api-2": {
"cpu_peak_percent": 32.29,
"memory_sample": "172.9MiB / 512MiB"
},
"mtusi2026lab5-broker-1": {
"cpu_peak_percent": 2.8,
"memory_sample": "10.27MiB / 128MiB"
},
"mtusi2026lab5-lb-1": {
"cpu_peak_percent": 26.47,
"memory_sample": "92.51MiB / 128MiB"
},
"mtusi2026lab5-outbox-1": {
"cpu_peak_percent": 1.16,
"memory_sample": "7.992MiB / 192MiB"
},
"mtusi2026lab5-postgres-1": {
"cpu_peak_percent": 80.89,
"memory_sample": "47.46MiB / 512MiB"
},
"mtusi2026lab5-reconciler-1": {
"cpu_peak_percent": 0.0,
"memory_sample": "7.254MiB / 128MiB"
},
"mtusi2026lab5-redis-1": {
"cpu_peak_percent": 5.81,
"memory_sample": "10.68MiB / 128MiB"
},
"mtusi2026lab5-s3-proxy-1": {
"cpu_peak_percent": 1.91,
"memory_sample": "63.8MiB / 64MiB"
},
"mtusi2026lab5-seaweedfs-1": {
"cpu_peak_percent": 11.68,
"memory_sample": "234.1MiB / 512MiB"
},
"mtusi2026lab5-worker-1": {
"cpu_peak_percent": 0.5,
"memory_sample": "8.121MiB / 1GiB"
}
}
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 5,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 35.243,
"concurrency": 4,
"successful_requests": 4983,
"failed_requests": 12,
"error_ratio": 0.002402,
"successful_rps": 141.389,
"successful_latency_ms": {
"p50": 4.8,
"p95": 20.439,
"p99": 47.073
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 5,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 35.243,
"concurrency": 4,
"successful_requests": 4983,
"failed_requests": 12,
"error_ratio": 0.002402,
"successful_rps": 141.389,
"successful_latency_ms": {
"p50": 4.8,
"p95": 20.439,
"p99": 47.073
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+3
View File
@@ -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.
+75
View File
@@ -0,0 +1,75 @@
{
"date": "2026-11-10",
"scenarios": [
{
"scenario": "variants_checksums_authorization_staging_cleanup",
"result": "PASS",
"seconds": 8.31,
"attachment_id": "e2232e4d-5e97-442b-9d3d-d203328ebd9c",
"variants": [
[
"thumbnail",
256,
160
],
[
"crop",
128,
128
],
[
"optimized",
320,
200
]
]
},
{
"scenario": "alpha_small_image_exif_orientation",
"result": "PASS",
"seconds": 3.728
},
{
"scenario": "invalid_bytes_pixels_limits",
"result": "PASS",
"seconds": 0.888
},
{
"scenario": "commit_publish_crash_worker_off_api_restart_broker_sigkill",
"result": "PASS",
"seconds": 38.078,
"attachment_id": "7e50a259-80d2-4203-b1a8-4182f79d7271",
"job_id": "45711acc-15a0-460f-9bc9-aa1de9d6818c",
"api_containers": [
"1f95f26c9e5777a1426a18080a78a3352662f077bcd58ea2db18847899bf2f79",
"d784bd95512a3b4984fd6530773a5df1bdeeb19662f30fab8c3b0a9f5bbc84af"
],
"stream_entries": 20
},
{
"scenario": "crash_after_s3_before_ack_lease_recovery_duplicate",
"result": "PASS",
"seconds": 50.195,
"attachment_id": "41963bfe-ab6d-4a4d-b2d8-6deb9ad64636",
"job_id": "90863853-d75f-4e39-8749-b3e361e5c134",
"attempts": 2
},
{
"scenario": "retry_jitter_exhaustion_failed_registry_audited_replay",
"result": "PASS",
"seconds": 23.34,
"attachment_id": "99d030ed-fb9f-45f4-9ff6-3757dee8c9d3",
"job_id": "8fc98e33-aee9-41c5-89b1-7f652e437612",
"first_backoff_seconds": 0.86
},
{
"scenario": "worker_memory_limit_permanent_failure_replay",
"result": "PASS",
"seconds": 17.94,
"attachment_id": "fceff53e-171f-408b-a8a4-586ad6917987",
"job_id": "2432d8b4-bbd3-4770-b3a9-c7e2de55acf6",
"decoder_limit_mb": 64,
"pixels": 9000000
}
]
}
+8
View File
@@ -0,0 +1,8 @@
PASS variants_checksums_authorization_staging_cleanup {"attachment_id": "e2232e4d-5e97-442b-9d3d-d203328ebd9c", "variants": [["thumbnail", 256, 160], ["crop", 128, 128], ["optimized", 320, 200]]}
PASS alpha_small_image_exif_orientation {}
PASS invalid_bytes_pixels_limits {}
PASS commit_publish_crash_worker_off_api_restart_broker_sigkill {"attachment_id": "7e50a259-80d2-4203-b1a8-4182f79d7271", "job_id": "45711acc-15a0-460f-9bc9-aa1de9d6818c", "api_containers": ["1f95f26c9e5777a1426a18080a78a3352662f077bcd58ea2db18847899bf2f79", "d784bd95512a3b4984fd6530773a5df1bdeeb19662f30fab8c3b0a9f5bbc84af"], "stream_entries": 20}
PASS crash_after_s3_before_ack_lease_recovery_duplicate {"attachment_id": "41963bfe-ab6d-4a4d-b2d8-6deb9ad64636", "job_id": "90863853-d75f-4e39-8749-b3e361e5c134", "attempts": 2}
PASS retry_jitter_exhaustion_failed_registry_audited_replay {"attachment_id": "99d030ed-fb9f-45f4-9ff6-3757dee8c9d3", "job_id": "8fc98e33-aee9-41c5-89b1-7f652e437612", "first_backoff_seconds": 0.86}
PASS worker_memory_limit_permanent_failure_replay {"attachment_id": "fceff53e-171f-408b-a8a4-586ad6917987", "job_id": "2432d8b4-bbd3-4770-b3a9-c7e2de55acf6", "decoder_limit_mb": 64, "pixels": 9000000}
PASS all lab5 level4 scenarios
+4
View File
@@ -0,0 +1,4 @@
Дата: 2026-11-10
Проверка: анонимный HTTP GET http://s3-proxy:8333/attachments/ из worker.
Результат: 403. Бакет недоступен без S3-подписи.
Команда: docker compose exec -T worker python3 (urllib.request, без Authorization).
+14
View File
@@ -0,0 +1,14 @@
{
"date": "2026-11-10",
"scenarios": [
{
"scenario": "worker_memory_limit_permanent_failure_replay",
"result": "PASS",
"seconds": 19.207,
"attachment_id": "3b4df2ed-4676-4d91-985a-4098a735bade",
"job_id": "74c09dbf-4a76-45b0-a62d-1c39c9b903c7",
"decoder_limit_mb": 64,
"pixels": 9000000
}
]
}
+106
View File
@@ -0,0 +1,106 @@
[
{
"id": "1f95f26c9e5777a1426a18080a78a3352662f077bcd58ea2db18847899bf2f79",
"name": "/mtusi2026lab5-api-1",
"service": "api",
"started_at": "2026-11-10T09:55:34.638626345Z",
"finished_at": "2026-11-10T09:55:34.380399345Z",
"running": true
},
{
"id": "d784bd95512a3b4984fd6530773a5df1bdeeb19662f30fab8c3b0a9f5bbc84af",
"name": "/mtusi2026lab5-api-2",
"service": "api",
"started_at": "2026-11-10T09:55:34.67442372Z",
"finished_at": "2026-11-10T09:55:34.38723122Z",
"running": true
},
{
"id": "89ffe34946fb1a71c4607fe1ccbd229acd21949a5e94f7bab3e7df6feffdcebf",
"name": "/mtusi2026lab5-broker-1",
"service": "broker",
"started_at": "2026-11-10T09:55:18.450372254Z",
"finished_at": "2026-11-10T09:55:18.193299171Z",
"running": true
},
{
"id": "1b68e49f683742f87ade453ed68001393bac3aff81360fd71980adaa0aca3411",
"name": "/mtusi2026lab5-lb-1",
"service": "lb",
"started_at": "2026-11-10T09:55:32.912589803Z",
"finished_at": "2026-11-10T09:55:32.680534136Z",
"running": true
},
{
"id": "3a481af14cd3da2b86d82e8555f4d6fd8b46e009a682cbe21d58bf3009047bbf",
"name": "/mtusi2026lab5-migrate-1",
"service": "migrate",
"started_at": "2026-11-10T09:55:35.553851554Z",
"finished_at": "2026-11-10T09:55:36.167287471Z",
"running": false
},
{
"id": "d92ce28ae20610132958827b79849685560fcbdbb03236520f1037da70fdfe40",
"name": "/mtusi2026lab5-outbox-1",
"service": "outbox",
"started_at": "2026-11-10T09:55:58.125443759Z",
"finished_at": "2026-11-10T09:55:16.740948878Z",
"running": true
},
{
"id": "547eb3a535367af710cd07bc258cc752b736d4a2570f642226b6fcbf57fdf2af",
"name": "/mtusi2026lab5-postgres-1",
"service": "postgres",
"started_at": "2026-11-10T09:55:18.636904087Z",
"finished_at": "2026-11-10T09:55:18.386241087Z",
"running": true
},
{
"id": "d1f8f8837a22417506f96a206b0480db59344b0e2081b1faee2fd0f2d52e140e",
"name": "/mtusi2026lab5-reconciler-1",
"service": "reconciler",
"started_at": "2026-11-10T09:52:26.345907424Z",
"finished_at": "0001-01-01T00:00:00Z",
"running": true
},
{
"id": "b9ddb9eb4230aff63e13e275a6fd632244e1723584c3083afc02448cf037a4b9",
"name": "/mtusi2026lab5-redis-1",
"service": "redis",
"started_at": "2026-11-10T09:55:18.633031921Z",
"finished_at": "2026-11-10T09:55:18.282901921Z",
"running": true
},
{
"id": "7e063b009cfd045415d5bf00354ae300960ba1609b32bafbf2010f0ca1bd9f55",
"name": "/mtusi2026lab5-s3-init-1",
"service": "s3-init",
"started_at": "2026-11-10T09:55:36.083260554Z",
"finished_at": "2026-11-10T09:55:57.717689175Z",
"running": false
},
{
"id": "28527f5aec922fcd162816bddd94d8b703de9ab86d8ca2a14cfdf4ad2b1cd438",
"name": "/mtusi2026lab5-s3-proxy-1",
"service": "s3-proxy",
"started_at": "2026-11-10T09:55:29.967960509Z",
"finished_at": "2026-11-10T09:55:29.801285218Z",
"running": true
},
{
"id": "02774e8206967d4701c1bd19da36848400b555e9b9a5577c5e861ba17cf59161",
"name": "/mtusi2026lab5-seaweedfs-1",
"service": "seaweedfs",
"started_at": "2026-11-10T09:55:21.361947255Z",
"finished_at": "2026-11-10T09:55:21.207359339Z",
"running": true
},
{
"id": "9e5ee3dc40629ac9934990ad3d9dd49ba477ca154bba131579c8bf6e860f7e05",
"name": "/mtusi2026lab5-worker-1",
"service": "worker",
"started_at": "2026-11-10T09:55:58.888983926Z",
"finished_at": "2026-11-10T09:55:17.67815592Z",
"running": true
}
]
+106
View File
@@ -0,0 +1,106 @@
[
{
"id": "1f95f26c9e5777a1426a18080a78a3352662f077bcd58ea2db18847899bf2f79",
"name": "/mtusi2026lab5-api-1",
"service": "api",
"started_at": "2026-11-10T09:53:05.145351637Z",
"finished_at": "2026-11-10T09:53:04.844832679Z",
"running": true
},
{
"id": "d784bd95512a3b4984fd6530773a5df1bdeeb19662f30fab8c3b0a9f5bbc84af",
"name": "/mtusi2026lab5-api-2",
"service": "api",
"started_at": "2026-11-10T09:53:05.17776072Z",
"finished_at": "2026-11-10T09:53:04.839647929Z",
"running": true
},
{
"id": "89ffe34946fb1a71c4607fe1ccbd229acd21949a5e94f7bab3e7df6feffdcebf",
"name": "/mtusi2026lab5-broker-1",
"service": "broker",
"started_at": "2026-11-10T09:53:00.054055301Z",
"finished_at": "2026-11-10T09:52:59.751936801Z",
"running": true
},
{
"id": "1b68e49f683742f87ade453ed68001393bac3aff81360fd71980adaa0aca3411",
"name": "/mtusi2026lab5-lb-1",
"service": "lb",
"started_at": "2026-11-10T09:47:44.843206794Z",
"finished_at": "2026-11-10T09:47:44.669404419Z",
"running": true
},
{
"id": "3a481af14cd3da2b86d82e8555f4d6fd8b46e009a682cbe21d58bf3009047bbf",
"name": "/mtusi2026lab5-migrate-1",
"service": "migrate",
"started_at": "2026-11-10T09:54:54.260868048Z",
"finished_at": "2026-11-10T09:54:54.428306674Z",
"running": false
},
{
"id": "d92ce28ae20610132958827b79849685560fcbdbb03236520f1037da70fdfe40",
"name": "/mtusi2026lab5-outbox-1",
"service": "outbox",
"started_at": "2026-11-10T09:52:59.076654676Z",
"finished_at": "2026-11-10T09:52:44.282186502Z",
"running": true
},
{
"id": "547eb3a535367af710cd07bc258cc752b736d4a2570f642226b6fcbf57fdf2af",
"name": "/mtusi2026lab5-postgres-1",
"service": "postgres",
"started_at": "2026-11-10T09:47:31.686270885Z",
"finished_at": "2026-11-10T09:47:31.518379469Z",
"running": true
},
{
"id": "d1f8f8837a22417506f96a206b0480db59344b0e2081b1faee2fd0f2d52e140e",
"name": "/mtusi2026lab5-reconciler-1",
"service": "reconciler",
"started_at": "2026-11-10T09:52:26.345907424Z",
"finished_at": "0001-01-01T00:00:00Z",
"running": true
},
{
"id": "b9ddb9eb4230aff63e13e275a6fd632244e1723584c3083afc02448cf037a4b9",
"name": "/mtusi2026lab5-redis-1",
"service": "redis",
"started_at": "2026-11-10T09:47:31.730370385Z",
"finished_at": "2026-11-10T09:47:31.511400302Z",
"running": true
},
{
"id": "7e063b009cfd045415d5bf00354ae300960ba1609b32bafbf2010f0ca1bd9f55",
"name": "/mtusi2026lab5-s3-init-1",
"service": "s3-init",
"started_at": "2026-11-10T09:54:54.742722049Z",
"finished_at": "2026-11-10T09:55:08.639504389Z",
"running": false
},
{
"id": "28527f5aec922fcd162816bddd94d8b703de9ab86d8ca2a14cfdf4ad2b1cd438",
"name": "/mtusi2026lab5-s3-proxy-1",
"service": "s3-proxy",
"started_at": "2026-11-10T09:47:43.485820377Z",
"finished_at": "2026-11-10T09:47:43.327631585Z",
"running": true
},
{
"id": "02774e8206967d4701c1bd19da36848400b555e9b9a5577c5e861ba17cf59161",
"name": "/mtusi2026lab5-seaweedfs-1",
"service": "seaweedfs",
"started_at": "2026-11-10T09:47:34.722645387Z",
"finished_at": "2026-11-10T09:47:34.545500762Z",
"running": true
},
{
"id": "9e5ee3dc40629ac9934990ad3d9dd49ba477ca154bba131579c8bf6e860f7e05",
"name": "/mtusi2026lab5-worker-1",
"service": "worker",
"started_at": "2026-11-10T09:54:51.811957756Z",
"finished_at": "2026-11-10T09:54:36.280447804Z",
"running": true
}
]
File diff suppressed because it is too large Load Diff
+2
View File
@@ -0,0 +1,2 @@
python3 tests/smoke.py --base-url "http://localhost:8080"
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
+26
View File
@@ -0,0 +1,26 @@
Дата: 2026-11-10, Europe/Moscow
Команда: make check
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
Команда: make test
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
Команда: go test ./...
Все пакеты PASS. internal/httpapi: 17.948s; internal/jobs: 0.416s.
Проверены прежние API/сессии/конкурентная идемпотентность и новые
TestPipeline_AtomicIntentClaimsFencingAndReplay,
TestPipeline_IntentRollsBackWithAttachment.
Команда: go test ./internal/images ./internal/jobs
ok mtusi2026/internal/images 0.817s
ok mtusi2026/internal/jobs (cached)
TestImageSubprocessDeadlineKillsChild: процесс с sleep(60) завершён по deadline 100ms.
Команда: go vet ./...
exit 0, без замечаний.
Команды: docker compose config --quiet; git diff --check
exit 0, без замечаний.
Это текстовая сводка фактически наблюдавшихся результатов, не полный лог Go.
Отдельные результаты fault-injection: lab5-pipeline.json, lab5-resource.json.