lab3: nginx, replicas, idempotency, tests

This commit is contained in:
2026-11-06 17:23:38 +03:00
commit 46c829b730
96 changed files with 206384 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
# Доказательства
Храните небольшие обезличенные результаты: команды и stdout проверок, JSON/CSV агрегатов нагрузки, EXPLAIN, dashboard JSON, текст разбора отказа. Укажите дату, commit, аппаратные лимиты и профиль нагрузки.
Не добавляйте .env, session tokens, cookies, приватные ключи, credentials, реальные сообщения, raw dumps и signed URLs. Для скриншотов скрывайте секреты. Большие логи/бинарные traces сохраняйте отдельно по правилам преподавателя; одного скриншота без методики недостаточно.
+200294
View File
File diff suppressed because it is too large Load Diff
+13
View File
@@ -0,0 +1,13 @@
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=0.42..5.54 rows=50 width=66) (actual time=0.103..0.111 rows=50 loops=1)
Buffers: shared hit=4
-> Index Scan using ix_messages_chat_created_id on messages (cost=0.42..8222.03 rows=80203 width=66) (actual time=0.102..0.107 rows=50 loops=1)
Index Cond: (chat_id = '66666666-6666-4666-8666-666666666666'::uuid)
Buffers: shared hit=4
Planning:
Buffers: shared hit=107
Planning Time: 0.865 ms
Execution Time: 0.168 ms
(9 rows)
+22
View File
@@ -0,0 +1,22 @@
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=6279.67..6285.42 rows=50 width=66) (actual time=7.323..8.152 rows=50 loops=1)
Buffers: shared hit=1063 read=72
-> Gather Merge (cost=6279.67..11696.05 rows=47099 width=66) (actual time=7.322..8.148 rows=50 loops=1)
Workers Planned: 1
Workers Launched: 1
Buffers: shared hit=1063 read=72
-> Sort (cost=5279.66..5397.40 rows=47099 width=66) (actual time=6.368..6.368 rows=26 loops=2)
Sort Key: created_at, id
Sort Method: top-N heapsort Memory: 38kB
Buffers: shared hit=1063 read=72
Worker 0: Sort Method: top-N heapsort Memory: 38kB
-> Parallel Index Scan using ix_messages_chat_only on messages (cost=0.42..3715.06 rows=47099 width=66) (actual time=0.031..2.837 rows=40000 loops=2)
--More-- ␍ ␍ Index Cond: (chat_id = '66666666-6666-4666-8666-66666666666--More-- ␍ ␍6'::uuid)
--More-- ␍ ␍ Buffers: shared hit=1048 read=72
--More-- ␍ ␍ Planning:
--More-- ␍ ␍ Buffers: shared hit=98 read=1
--More-- ␍ ␍ Planning Time: 0.335 ms
--More-- ␍ ␍ Execution Time: 8.200 ms
--More-- ␍ ␍(18 rows)
--More-- ␍ ␍
+29
View File
@@ -0,0 +1,29 @@
./scripts/failover-test.sh app1
Останавливаю app1
16:50:48.3N
Останавливаю app1...
app1 остановлен
Шлю запросы каждые 0.5 сек, смотрю код и x-instance-id
16:50:48.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:50:51.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:50:51.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:50:52.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:50:52.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:50:53.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:50:53.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:50:54.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:50:55.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:50:55.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:50:56.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:50:58.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:50:59.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:50:59.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:51:00.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:51:00.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:51:01.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:51:02.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:51:02.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
16:51:03.3N code=200 x-instance-id: 4749a273-c09f-47b2-9172-f373b786233b
Поднимаю app1 обратно
+29
View File
@@ -0,0 +1,29 @@
./scripts/failover-test.sh app2
Останавливаю app2
16:51:08.3N
Останавливаю app2...
app2 остановлен
Шлю запросы каждые 0.5 сек, смотрю код и x-instance-id
16:51:09.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:11.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:14.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:14.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:15.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:15.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:16.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:17.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:17.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:18.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:18.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:19.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:21.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:22.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:22.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:23.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:24.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:24.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:25.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
16:51:25.3N code=200 x-instance-id: 534c1846-b123-481b-a9c4-71c7049315ae
Поднимаю app2 обратно
+18
View File
@@ -0,0 +1,18 @@
python3 tests/load.py --base-url "http://localhost:8080"
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30,
"elapsed_seconds": 30.609,
"concurrency": 4,
"successful_requests": 8195,
"failed_requests": 8,
"error_ratio": 0.000975,
"successful_rps": 267.73,
"successful_latency_ms": {
"p50": 9.403,
"p95": 12.088,
"p99": 17.671
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30,
"elapsed_seconds": 32.212,
"concurrency": 20,
"successful_requests": 7940,
"failed_requests": 60,
"error_ratio": 0.0075,
"successful_rps": 246.491,
"successful_latency_ms": {
"p50": 32.546,
"p95": 76.906,
"p99": 114.623
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+22
View File
@@ -0,0 +1,22 @@
=== Замер для 2 реплик ===
Лимиты: cpus=0.5, memory=512M на реплику (суммарно 1 CPU / 1 GB)
Конфигурация: app1 + app2 за Nginx
Нагрузка: make load (POST /messages, 30 сек, concurrency 4)
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30,
"elapsed_seconds": 31.155,
"concurrency": 4,
"successful_requests": 8156,
"failed_requests": 3,
"error_ratio": 0.000368,
"successful_rps": 261.789,
"successful_latency_ms": {
"p50": 8.613,
"p95": 36.591,
"p99": 48.722
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
@@ -0,0 +1,17 @@
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30,
"elapsed_seconds": 33.193,
"concurrency": 20,
"successful_requests": 8386,
"failed_requests": 60,
"error_ratio": 0.007104,
"successful_rps": 252.642,
"successful_latency_ms": {
"p50": 18.858,
"p95": 78.217,
"p99": 156.447
},
"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": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30,
"elapsed_seconds": 31.089,
"concurrency": 4,
"successful_requests": 8190,
"failed_requests": 12,
"error_ratio": 0.001463,
"successful_rps": 263.441,
"successful_latency_ms": {
"p50": 7.843,
"p95": 11.567,
"p99": 16.163
},
"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": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30,
"elapsed_seconds": 32.952,
"concurrency": 20,
"successful_requests": 8299,
"failed_requests": 20,
"error_ratio": 0.002404,
"successful_rps": 251.855,
"successful_latency_ms": {
"p50": 9.001,
"p95": 274.971,
"p99": 389.683
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+18
View File
@@ -0,0 +1,18 @@
python3 tests/load.py --base-url "http://localhost:8080"
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30,
"elapsed_seconds": 30.999,
"concurrency": 4,
"successful_requests": 8165,
"failed_requests": 12,
"error_ratio": 0.001468,
"successful_rps": 263.396,
"successful_latency_ms": {
"p50": 7.054,
"p95": 11.933,
"p99": 23.37
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+18
View File
@@ -0,0 +1,18 @@
python3 tests/load.py --base-url "http://localhost:8080"
{
"lab": 3,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30,
"elapsed_seconds": 32.012,
"concurrency": 4,
"successful_requests": 8160,
"failed_requests": 2,
"error_ratio": 0.000245,
"successful_rps": 254.903,
"successful_latency_ms": {
"p50": 6.556,
"p95": 53.415,
"p99": 69.04
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+32
View File
@@ -0,0 +1,32 @@
./scripts/rolling-load.sh
Нагрузка: 30 запросов с интервалом 0.5 сек
16:51:30 code=200 instance=534c1846-b123-481b-a9c4-71c7049315ae
16:51:30 code=200 instance=0a6121d9-07cc-4491-9937-e8b68e5156c5
16:51:31 code=200 instance=0a6121d9-07cc-4491-9937-e8b68e5156c5
16:51:33 code=200 instance=0a6121d9-07cc-4491-9937-e8b68e5156c5
16:51:34 code=200 instance=06026485-762d-4e6a-a368-e1bac311a756
16:51:35 code=200 instance=0a6121d9-07cc-4491-9937-e8b68e5156c5
16:51:35 code=200 instance=06026485-762d-4e6a-a368-e1bac311a756
16:51:36 code=200 instance=0a6121d9-07cc-4491-9937-e8b68e5156c5
16:51:36 code=200 instance=06026485-762d-4e6a-a368-e1bac311a756
16:51:37 code=200 instance=0a6121d9-07cc-4491-9937-e8b68e5156c5
16:51:37 code=200 instance=06026485-762d-4e6a-a368-e1bac311a756
16:51:38 code=200 instance=0a6121d9-07cc-4491-9937-e8b68e5156c5
16:51:38 code=200 instance=06026485-762d-4e6a-a368-e1bac311a756
16:51:39 code=200 instance=06026485-762d-4e6a-a368-e1bac311a756
16:51:40 code=200 instance=06026485-762d-4e6a-a368-e1bac311a756
16:51:41 code=200 instance=86e75a44-8448-4aec-99c1-a2d9378f0dc2
16:51:41 code=200 instance=06026485-762d-4e6a-a368-e1bac311a756
16:51:42 code=200 instance=86e75a44-8448-4aec-99c1-a2d9378f0dc2
16:51:43 code=200 instance=06026485-762d-4e6a-a368-e1bac311a756
16:51:43 code=200 instance=86e75a44-8448-4aec-99c1-a2d9378f0dc2
16:51:44 code=200 instance=06026485-762d-4e6a-a368-e1bac311a756
16:51:44 code=200 instance=86e75a44-8448-4aec-99c1-a2d9378f0dc2
16:51:45 code=200 instance=06026485-762d-4e6a-a368-e1bac311a756
16:51:45 code=200 instance=86e75a44-8448-4aec-99c1-a2d9378f0dc2
16:51:46 code=200 instance=06026485-762d-4e6a-a368-e1bac311a756
16:51:46 code=200 instance=86e75a44-8448-4aec-99c1-a2d9378f0dc2
16:51:47 code=200 instance=06026485-762d-4e6a-a368-e1bac311a756
16:51:47 code=200 instance=86e75a44-8448-4aec-99c1-a2d9378f0dc2
16:51:48 code=200 instance=06026485-762d-4e6a-a368-e1bac311a756
16:51:49 code=200 instance=86e75a44-8448-4aec-99c1-a2d9378f0dc2
+159
View File
@@ -0,0 +1,159 @@
./scripts/rolling-update.sh
Rolling update: app1
Container mtusi2026lab3-app1-1 Stopping
Container mtusi2026lab3-app1-1 Stopped
#0 building with "desktop-linux" instance using docker driver
#1 [app1 internal] load build definition from Dockerfile
#1 transferring dockerfile: 685B done
#1 DONE 0.0s
#2 [app1 internal] load metadata for docker.io/library/python:3.13-slim
#2 DONE 1.8s
#3 [app1 internal] load .dockerignore
#3 transferring context: 279B done
#3 DONE 0.0s
#4 [app1 1/9] FROM docker.io/library/python:3.13-slim@sha256:09a17cad02668ae61ece136b4fd36ac3849e14f670ebedb637ea3e15580525bc
#4 DONE 0.0s
#5 [app1 internal] load build context
#5 transferring context: 4.73kB done
#5 DONE 0.0s
#6 [app1 4/9] RUN pip install --no-cache-dir -r requirements-dev.txt
#6 CACHED
#7 [app1 3/9] COPY requirements-dev.txt .
#7 CACHED
#8 [app1 2/9] WORKDIR /app
#8 CACHED
#9 [app1 8/9] COPY alembic/ alembic/
#9 CACHED
#10 [app1 6/9] COPY app/ app/
#10 CACHED
#11 [app1 7/9] COPY alembic.ini .
#11 CACHED
#12 [app1 5/9] RUN useradd --create-home --shell /bin/bash appuser
#12 CACHED
#13 [app1 9/9] RUN chown -R appuser:appuser /app/alembic
#13 CACHED
#14 [app1] exporting to image
#14 exporting layers done
#14 writing image sha256:af1621af7e8af7324cc026feef618c950fa872eeb17c4333dade10b720a57503 done
#14 naming to docker.io/library/mtusi2026lab3-app1 done
#14 DONE 0.0s
#15 [app1] resolving provenance for metadata file
#15 DONE 0.0s
Container mtusi_messenger_redis Running
Container mtusi_messenger_db Running
Container mtusi2026lab3-app1-1 Created
Container mtusi_messenger_redis Waiting
Container mtusi_messenger_db Waiting
Container mtusi_messenger_redis Healthy
Container mtusi_messenger_db Healthy
Container mtusi2026lab3-app1-1 Starting
Container mtusi2026lab3-app1-1 Started
Жду, пока app1 станет healthy...
Rolling update: app2
Container mtusi2026lab3-app2-1 Stopping
Container mtusi2026lab3-app2-1 Stopped
#0 building with "desktop-linux" instance using docker driver
#1 [app2 internal] load build definition from Dockerfile
#1 transferring dockerfile: 685B done
#1 DONE 0.0s
#2 [app2 internal] load metadata for docker.io/library/python:3.13-slim
#2 DONE 0.3s
#3 [app2 internal] load .dockerignore
#3 transferring context: 279B done
#3 DONE 0.0s
#4 [app2 1/9] FROM docker.io/library/python:3.13-slim@sha256:09a17cad02668ae61ece136b4fd36ac3849e14f670ebedb637ea3e15580525bc
#4 DONE 0.0s
#5 [app2 internal] load build context
#5 transferring context: 4.73kB done
#5 DONE 0.0s
#6 [app2 3/9] COPY requirements-dev.txt .
#6 CACHED
#7 [app2 7/9] COPY alembic.ini .
#7 CACHED
#8 [app2 8/9] COPY alembic/ alembic/
#8 CACHED
#9 [app2 5/9] RUN useradd --create-home --shell /bin/bash appuser
#9 CACHED
#10 [app2 2/9] WORKDIR /app
#10 CACHED
#11 [app2 4/9] RUN pip install --no-cache-dir -r requirements-dev.txt
#11 CACHED
#12 [app2 6/9] COPY app/ app/
#12 CACHED
#13 [app2 9/9] RUN chown -R appuser:appuser /app/alembic
#13 CACHED
#14 [app2] exporting to image
#14 exporting layers done
#14 writing image sha256:9c5ffbef790bf603d2cd9d54e18df8b05aa9541f5201974646cfd5fb1d46720b done
#14 naming to docker.io/library/mtusi2026lab3-app2 done
#14 DONE 0.0s
#15 [app2] resolving provenance for metadata file
#15 DONE 0.0s
Container mtusi_messenger_redis Running
Container mtusi_messenger_db Running
Container mtusi2026lab3-app2-1 Created
Container mtusi_messenger_redis Waiting
Container mtusi_messenger_db Waiting
Container mtusi_messenger_db Healthy
Container mtusi_messenger_redis Healthy
Container mtusi2026lab3-app2-1 Starting
Container mtusi2026lab3-app2-1 Started
Жду, пока app2 станет healthy...
Проверка: обе реплики живы
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
␍ 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0␍100 15 100 15 0 0 2824 0 --:--:-- --:--:-- --:--:-- 3000
HTTP/1.1 200 OK
Server: nginx/1.29.4
Date: Fri, 06 Nov 2026 13:51:44 GMT
Content-Type: application/json
Content-Length: 15
Connection: keep-alive
x-instance-id: 06026485-762d-4e6a-a368-e1bac311a756
x-request-id: 9fd1f3e6-0c5a-4cce-a727-35467ef553b8
{"status":"ok"} % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
␍ 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0␍100 15 100 15 0 0 3764 0 --:--:-- --:--:-- --:--:-- 5000
HTTP/1.1 200 OK
Server: nginx/1.29.4
Date: Fri, 06 Nov 2026 13:51:44 GMT
Content-Type: application/json
Content-Length: 15
Connection: keep-alive
x-instance-id: 86e75a44-8448-4aec-99c1-a2d9378f0dc2
x-request-id: 23fcdcf5-8f9c-48f3-8973-4c5a49186e23
{"status":"ok"}
+10
View File
@@ -0,0 +1,10 @@
HTTP/1.1 200 OK
Server: nginx/1.29.4
Date: Sat, 31 Oct 2026 14:20:31 GMT
Content-Type: application/json
Content-Length: 133
Connection: keep-alive
x-instance-id: 0bde7749-b376-47a1-b6b5-d6996cc8f451
x-request-id: b58b0c54-8f13-48ba-a469-b63f3bdd62f5
{"id":"75ff0b0b-2cc0-43cf-af38-a50ff2968506","username":"lbtest","display_name":"LB Test","created_at":"2026-10-31T14:06:35.944873Z"}
+10
View File
@@ -0,0 +1,10 @@
HTTP/1.1 200 OK
Server: nginx/1.29.4
Date: Sat, 31 Oct 2026 14:20:31 GMT
Content-Type: application/json
Content-Length: 133
Connection: keep-alive
x-instance-id: fd34912d-faf5-44cf-bb1c-5a6b6ab368dd
x-request-id: c4499fdd-21c8-4b60-90be-e47e079ede18
{"id":"75ff0b0b-2cc0-43cf-af38-a50ff2968506","username":"lbtest","display_name":"LB Test","created_at":"2026-10-31T14:06:35.944873Z"}
+10
View File
@@ -0,0 +1,10 @@
HTTP/1.1 200 OK
Server: nginx/1.29.4
Date: Sat, 31 Oct 2026 14:20:31 GMT
Content-Type: application/json
Content-Length: 133
Connection: keep-alive
x-instance-id: 0bde7749-b376-47a1-b6b5-d6996cc8f451
x-request-id: 40834f73-64c3-40de-adfe-049ecc07a4d4
{"id":"75ff0b0b-2cc0-43cf-af38-a50ff2968506","username":"lbtest","display_name":"LB Test","created_at":"2026-10-31T14:06:35.944873Z"}
+10
View File
@@ -0,0 +1,10 @@
HTTP/1.1 200 OK
Server: nginx/1.29.4
Date: Sat, 31 Oct 2026 14:20:31 GMT
Content-Type: application/json
Content-Length: 133
Connection: keep-alive
x-instance-id: fd34912d-faf5-44cf-bb1c-5a6b6ab368dd
x-request-id: 3a53c323-e47a-4eb4-8321-bd289f81d751
{"id":"75ff0b0b-2cc0-43cf-af38-a50ff2968506","username":"lbtest","display_name":"LB Test","created_at":"2026-10-31T14:06:35.944873Z"}
+12
View File
@@ -0,0 +1,12 @@
python3 -m pytest tests/test_resilience.py -v
============================= test session starts ==============================
platform darwin -- Python 3.13.2, pytest-8.3.4, pluggy-1.6.0 -- /Users/kirill/Downloads/drone_simulation_project/.venv/bin/python3
cachedir: .pytest_cache
rootdir: /Users/kirill/Desktop/esp/temka/mtusi2026lab3
plugins: platformdirs-4.12.2, anyio-3.6.2
collecting ... collected 2 items
tests/test_resilience.py::test_postgres_down_returns_503 PASSED [ 50%]
tests/test_resilience.py::test_redis_down_returns_500_json PASSED [100%]
============================== 2 passed in 6.84s ===============================
+13
View File
@@ -0,0 +1,13 @@
python3 -m pytest tests/test_lab3.py -v
============================= test session starts ==============================
platform darwin -- Python 3.13.2, pytest-8.3.4, pluggy-1.6.0 -- /Users/kirill/Downloads/drone_simulation_project/.venv/bin/python3
cachedir: .pytest_cache
rootdir: /Users/kirill/Desktop/esp/temka/mtusi2026lab3
plugins: platformdirs-4.12.2, anyio-3.6.2
collecting ... collected 3 items
tests/test_lab3.py::test_idempotency_same_body_returns_same_id PASSED [ 33%]
tests/test_lab3.py::test_idempotency_different_body_returns_409 PASSED [ 66%]
tests/test_lab3.py::test_shared_session_across_replicas PASSED [100%]
============================== 3 passed in 1.50s ===============================