Исправить U+0000 и гонку готовности PostgreSQL; добавить проверки
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"composite_operation_rollback": true,
|
||||
"redis_user_cache_ttl_seconds": 60,
|
||||
"redis_outage_seconds": 0.2969403329999998,
|
||||
"redis_outage_seconds": 0.05048745900000007,
|
||||
"redis_recovered_without_relogin": true,
|
||||
"postgres_outage_response_seconds": 0.006768832999999752,
|
||||
"postgres_outage_response_seconds": 0.004356375000000412,
|
||||
"postgres_recovered_without_relogin": true,
|
||||
"short_ttl_expired": true
|
||||
}
|
||||
+554
-674
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,15 @@
|
||||
[
|
||||
{
|
||||
"service": "api",
|
||||
"container_id": "03414eeb9af4",
|
||||
"started_at": "2026-10-23T06:53:58.384822282Z",
|
||||
"container_id": "6b9b8576b1cd",
|
||||
"started_at": "2026-10-23T09:20:44.739602998Z",
|
||||
"status": "running",
|
||||
"volumes": []
|
||||
},
|
||||
{
|
||||
"service": "postgres",
|
||||
"container_id": "f8be6202d5e4",
|
||||
"started_at": "2026-10-23T06:53:51.683479639Z",
|
||||
"container_id": "07430ea862b6",
|
||||
"started_at": "2026-10-23T09:20:41.28275813Z",
|
||||
"status": "running",
|
||||
"volumes": [
|
||||
"mtusi-lab2_postgres_data"
|
||||
@@ -18,7 +18,7 @@
|
||||
{
|
||||
"service": "redis",
|
||||
"container_id": "5fecf0c5edd1",
|
||||
"started_at": "2026-10-23T06:53:51.383818051Z",
|
||||
"started_at": "2026-10-23T09:20:41.313335565Z",
|
||||
"status": "running",
|
||||
"volumes": [
|
||||
"b72dab0a9ef82932abd5655e09a614b5c99b3a7cef959426f05ad0a2ed7dbc79"
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
[
|
||||
{
|
||||
"service": "api",
|
||||
"container_id": "03414eeb9af4",
|
||||
"started_at": "2026-10-23T06:53:29.066897456Z",
|
||||
"container_id": "6b9b8576b1cd",
|
||||
"started_at": "2026-10-23T09:19:48.119673288Z",
|
||||
"status": "running",
|
||||
"volumes": []
|
||||
},
|
||||
{
|
||||
"service": "postgres",
|
||||
"container_id": "f8be6202d5e4",
|
||||
"started_at": "2026-10-23T06:53:24.074466953Z",
|
||||
"container_id": "07430ea862b6",
|
||||
"started_at": "2026-10-23T09:19:48.24800751Z",
|
||||
"status": "running",
|
||||
"volumes": [
|
||||
"mtusi-lab2_postgres_data"
|
||||
@@ -18,7 +18,7 @@
|
||||
{
|
||||
"service": "redis",
|
||||
"container_id": "5fecf0c5edd1",
|
||||
"started_at": "2026-10-23T06:53:23.920707731Z",
|
||||
"started_at": "2026-10-23T09:19:48.06854916Z",
|
||||
"status": "running",
|
||||
"volumes": [
|
||||
"b72dab0a9ef82932abd5655e09a614b5c99b3a7cef959426f05ad0a2ed7dbc79"
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
Image mtusi-lab2-api Building
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 656B done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 [internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 739B done
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [internal] load metadata for docker.io/library/python:3.12.8-slim-bookworm@sha256:2199a62885a12290dc9c5be3ca0681d367576ab7bf037da120e564723292a2f0
|
||||
#3 DONE 0.0s
|
||||
|
||||
#4 [internal] load .dockerignore
|
||||
#4 transferring context: 132B done
|
||||
#4 DONE 0.0s
|
||||
|
||||
#5 [internal] load build context
|
||||
#5 transferring context: 12.71kB done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 [1/7] FROM docker.io/library/python:3.12.8-slim-bookworm@sha256:2199a62885a12290dc9c5be3ca0681d367576ab7bf037da120e564723292a2f0
|
||||
#6 resolve docker.io/library/python:3.12.8-slim-bookworm@sha256:2199a62885a12290dc9c5be3ca0681d367576ab7bf037da120e564723292a2f0 done
|
||||
#6 DONE 0.0s
|
||||
|
||||
#7 [4/7] COPY requirements.txt ./
|
||||
#7 CACHED
|
||||
|
||||
#8 [2/7] WORKDIR /app
|
||||
#8 CACHED
|
||||
|
||||
#9 [3/7] RUN groupadd --gid 10001 app && useradd --uid 10001 --gid app --no-create-home app
|
||||
#9 CACHED
|
||||
|
||||
#10 [5/7] RUN pip install --no-cache-dir -r requirements.txt
|
||||
#10 CACHED
|
||||
|
||||
#11 [6/7] COPY src/ ./src/
|
||||
#11 DONE 0.0s
|
||||
|
||||
#12 [7/7] COPY migrations/ ./migrations/
|
||||
#12 DONE 0.0s
|
||||
|
||||
#13 exporting to image
|
||||
#13 exporting layers 0.0s done
|
||||
#13 exporting manifest sha256:4629666110b9f12ff95b707e9aafdd14712e1eacef6918851f271840c4a0a7dc done
|
||||
#13 exporting config sha256:7c4d81b7399c8d2e57ab11ad9087b262cbdc4f79ce3298db7087079e530ce18a done
|
||||
#13 exporting attestation manifest sha256:7e311d74504e1fe4150d50a931487c137683dce1c5ae5c6779c0493722acd01a done
|
||||
#13 exporting manifest list sha256:0712b708d3a29530642a2c22dea53064fbfdfedc9537a18f3a04ba343e11da7f done
|
||||
#13 naming to docker.io/library/mtusi-lab2-api:latest done
|
||||
#13 unpacking to docker.io/library/mtusi-lab2-api:latest done
|
||||
#13 DONE 0.1s
|
||||
|
||||
#14 resolving provenance for metadata file
|
||||
#14 DONE 0.0s
|
||||
Image mtusi-lab2-api Built
|
||||
Container mtusi-lab2-postgres-1 Recreate
|
||||
Container mtusi-lab2-postgres-1 Recreated
|
||||
Container mtusi-lab2-api-1 Recreate
|
||||
Container mtusi-lab2-api-1 Recreated
|
||||
Container mtusi-lab2-postgres-1 Starting
|
||||
Container mtusi-lab2-redis-1 Starting
|
||||
Container mtusi-lab2-postgres-1 Started
|
||||
Container mtusi-lab2-redis-1 Started
|
||||
Container mtusi-lab2-redis-1 Waiting
|
||||
Container mtusi-lab2-postgres-1 Waiting
|
||||
Container mtusi-lab2-redis-1 Healthy
|
||||
Container mtusi-lab2-postgres-1 Healthy
|
||||
Container mtusi-lab2-api-1 Starting
|
||||
Container mtusi-lab2-api-1 Started
|
||||
Container mtusi-lab2-api-1 Waiting
|
||||
Container mtusi-lab2-postgres-1 Waiting
|
||||
Container mtusi-lab2-redis-1 Waiting
|
||||
Container mtusi-lab2-redis-1 Healthy
|
||||
Container mtusi-lab2-postgres-1 Healthy
|
||||
Container mtusi-lab2-api-1 Healthy
|
||||
@@ -0,0 +1,116 @@
|
||||
Local configuration ready; secrets were not printed.
|
||||
Image mtusi-lab2-review-50a92603-api Building
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 704B done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 resolving provenance for metadata file
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [internal] load build definition from Dockerfile
|
||||
#3 transferring dockerfile: 739B done
|
||||
#3 DONE 0.0s
|
||||
|
||||
#4 [internal] load metadata for docker.io/library/python:3.12.8-slim-bookworm@sha256:2199a62885a12290dc9c5be3ca0681d367576ab7bf037da120e564723292a2f0
|
||||
#4 DONE 0.0s
|
||||
|
||||
#5 [internal] load .dockerignore
|
||||
#5 transferring context: 132B done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 [internal] load build context
|
||||
#6 transferring context: 25.73kB done
|
||||
#6 DONE 0.0s
|
||||
|
||||
#7 [1/7] FROM docker.io/library/python:3.12.8-slim-bookworm@sha256:2199a62885a12290dc9c5be3ca0681d367576ab7bf037da120e564723292a2f0
|
||||
#7 resolve docker.io/library/python:3.12.8-slim-bookworm@sha256:2199a62885a12290dc9c5be3ca0681d367576ab7bf037da120e564723292a2f0 done
|
||||
#7 DONE 0.0s
|
||||
|
||||
#8 [2/7] WORKDIR /app
|
||||
#8 CACHED
|
||||
|
||||
#9 [4/7] COPY requirements.txt ./
|
||||
#9 CACHED
|
||||
|
||||
#10 [5/7] RUN pip install --no-cache-dir -r requirements.txt
|
||||
#10 CACHED
|
||||
|
||||
#11 [6/7] COPY src/ ./src/
|
||||
#11 CACHED
|
||||
|
||||
#12 [3/7] RUN groupadd --gid 10001 app && useradd --uid 10001 --gid app --no-create-home app
|
||||
#12 CACHED
|
||||
|
||||
#13 [7/7] COPY migrations/ ./migrations/
|
||||
#13 CACHED
|
||||
|
||||
#14 exporting to image
|
||||
#14 exporting layers done
|
||||
#14 exporting manifest sha256:9de8694da45da73001c72c27f49f41b2b32dda6f170fb0ce738ced563c2c9471 done
|
||||
#14 exporting config sha256:21388fc537a563dea4b9d14946bc95036d2ca3727ebed78cdeb410843e7f3700 done
|
||||
#14 exporting attestation manifest sha256:ced1e33e702d25de0036f12d77f8ba1e49335255d54c60a9de74a012000fc609 done
|
||||
#14 exporting manifest list sha256:6e728a75c92839d45b87038fbbe85f2db96e887e3614496fcc34a4ede2824c42 done
|
||||
#14 naming to docker.io/library/mtusi-lab2-review-50a92603-api:latest done
|
||||
#14 unpacking to docker.io/library/mtusi-lab2-review-50a92603-api:latest done
|
||||
#14 DONE 0.0s
|
||||
Image mtusi-lab2-review-50a92603-api Built
|
||||
Network mtusi-lab2-review-50a92603_default Creating
|
||||
Network mtusi-lab2-review-50a92603_default Created
|
||||
Volume mtusi-lab2-review-50a92603_postgres_data Creating
|
||||
Volume mtusi-lab2-review-50a92603_postgres_data Created
|
||||
Container mtusi-lab2-review-50a92603-redis-1 Creating
|
||||
Container mtusi-lab2-review-50a92603-postgres-1 Creating
|
||||
Container mtusi-lab2-review-50a92603-postgres-1 Created
|
||||
Container mtusi-lab2-review-50a92603-redis-1 Created
|
||||
Container mtusi-lab2-review-50a92603-api-1 Creating
|
||||
Container mtusi-lab2-review-50a92603-api-1 Created
|
||||
Container mtusi-lab2-review-50a92603-postgres-1 Starting
|
||||
Container mtusi-lab2-review-50a92603-redis-1 Starting
|
||||
Container mtusi-lab2-review-50a92603-postgres-1 Started
|
||||
Container mtusi-lab2-review-50a92603-redis-1 Started
|
||||
Container mtusi-lab2-review-50a92603-postgres-1 Waiting
|
||||
Container mtusi-lab2-review-50a92603-redis-1 Waiting
|
||||
Container mtusi-lab2-review-50a92603-postgres-1 Healthy
|
||||
Container mtusi-lab2-review-50a92603-redis-1 Healthy
|
||||
Container mtusi-lab2-review-50a92603-api-1 Starting
|
||||
Container mtusi-lab2-review-50a92603-api-1 Started
|
||||
Container mtusi-lab2-review-50a92603-api-1 Waiting
|
||||
Container mtusi-lab2-review-50a92603-postgres-1 Waiting
|
||||
Container mtusi-lab2-review-50a92603-redis-1 Waiting
|
||||
Container mtusi-lab2-review-50a92603-redis-1 Healthy
|
||||
Container mtusi-lab2-review-50a92603-postgres-1 Healthy
|
||||
Container mtusi-lab2-review-50a92603-api-1 Healthy
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
python3 tests/smoke.py --base-url "http://127.0.0.1:18086"
|
||||
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||
BASE_URL="http://127.0.0.1:18086" python3 -m unittest discover -s student-tests -p test_api.py -v
|
||||
test_concurrent_messages_and_pagination (test_api.APIContract) ... ok
|
||||
test_cursor_scope_and_validation (test_api.APIContract) ... ok
|
||||
test_foreign_chat (test_api.APIContract) ... ok
|
||||
test_invalid_chat_creation (test_api.APIContract) ... ok
|
||||
test_malformed_json_and_extra_fields (test_api.APIContract) ... ok
|
||||
test_registration_race (test_api.APIContract) ... ok
|
||||
test_unicode_limits (test_api.APIContract) ... ok
|
||||
test_unicode_nul_round_trip (test_api.APIContract) ... ok
|
||||
test_unicode_password_basic_and_logout (test_api.APIContract) ... ok
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Ran 9 tests in 3.405s
|
||||
|
||||
OK
|
||||
PASS: clean local clone, fresh Compose project/volume, migrations 001+002, public smoke and all nine student tests.
|
||||
Container mtusi-lab2-review-50a92603-api-1 Stopping
|
||||
Container mtusi-lab2-review-50a92603-api-1 Stopped
|
||||
Container mtusi-lab2-review-50a92603-api-1 Removing
|
||||
Container mtusi-lab2-review-50a92603-api-1 Removed
|
||||
Container mtusi-lab2-review-50a92603-postgres-1 Stopping
|
||||
Container mtusi-lab2-review-50a92603-redis-1 Stopping
|
||||
Container mtusi-lab2-review-50a92603-redis-1 Stopped
|
||||
Container mtusi-lab2-review-50a92603-redis-1 Removing
|
||||
Container mtusi-lab2-review-50a92603-redis-1 Removed
|
||||
Container mtusi-lab2-review-50a92603-postgres-1 Stopped
|
||||
Container mtusi-lab2-review-50a92603-postgres-1 Removing
|
||||
Container mtusi-lab2-review-50a92603-postgres-1 Removed
|
||||
Network mtusi-lab2-review-50a92603_default Removing
|
||||
Network mtusi-lab2-review-50a92603_default Removed
|
||||
@@ -0,0 +1,16 @@
|
||||
python3 student-tests/dependencies.py
|
||||
Container mtusi-lab2-redis-1 Stopping
|
||||
Container mtusi-lab2-redis-1 Stopped
|
||||
Container mtusi-lab2-redis-1 Starting
|
||||
Container mtusi-lab2-redis-1 Started
|
||||
Container mtusi-lab2-redis-1 Waiting
|
||||
Container mtusi-lab2-redis-1 Healthy
|
||||
Container mtusi-lab2-postgres-1 Stopping
|
||||
Container mtusi-lab2-postgres-1 Stopped
|
||||
Container mtusi-lab2-postgres-1 Starting
|
||||
Container mtusi-lab2-postgres-1 Started
|
||||
Container mtusi-lab2-postgres-1 Waiting
|
||||
Container mtusi-lab2-postgres-1 Healthy
|
||||
Container mtusi-lab2-expiry-29f426d1 Creating
|
||||
Container mtusi-lab2-expiry-29f426d1 Created
|
||||
PASS: rollback, real Redis TTL/cache, Redis outage, PostgreSQL outage/recovery and session expiry.
|
||||
@@ -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.
|
||||
@@ -0,0 +1,21 @@
|
||||
Fresh restore run 1
|
||||
Container mtusi-lab2-api-run-2c95cff15d63 Creating
|
||||
Container mtusi-lab2-api-run-2c95cff15d63 Created
|
||||
Container mtusi-lab2-api-run-dd11ae88dd79 Creating
|
||||
Container mtusi-lab2-api-run-dd11ae88dd79 Created
|
||||
PASS: 100000 messages; two indexes; write costs; backup/restore counts, samples and full checksum match.
|
||||
Backup seconds: 0.281 Restore seconds: 0.268
|
||||
Fresh restore run 2
|
||||
Container mtusi-lab2-api-run-60ccc9d0034f Creating
|
||||
Container mtusi-lab2-api-run-60ccc9d0034f Created
|
||||
Container mtusi-lab2-api-run-2292e9ea796b Creating
|
||||
Container mtusi-lab2-api-run-2292e9ea796b Created
|
||||
PASS: 100000 messages; two indexes; write costs; backup/restore counts, samples and full checksum match.
|
||||
Backup seconds: 0.304 Restore seconds: 0.289
|
||||
Fresh restore run 3
|
||||
Container mtusi-lab2-api-run-f8267d018f9d Creating
|
||||
Container mtusi-lab2-api-run-f8267d018f9d Created
|
||||
Container mtusi-lab2-api-run-b73f035b1b8c Creating
|
||||
Container mtusi-lab2-api-run-b73f035b1b8c Created
|
||||
PASS: 100000 messages; two indexes; write costs; backup/restore counts, samples and full checksum match.
|
||||
Backup seconds: 0.28 Restore seconds: 0.267
|
||||
@@ -0,0 +1,209 @@
|
||||
[
|
||||
{
|
||||
"run": 1,
|
||||
"backup": {
|
||||
"format": "pg_dump custom",
|
||||
"bytes": 2655885,
|
||||
"dump_seconds": 0.2805722919999998,
|
||||
"bootstrap_seconds": 0.8350770000000001,
|
||||
"restore_seconds": 0.2675151250000001,
|
||||
"restored_database": "restore_8e3b0298c2c4",
|
||||
"source_container_id": "07430ea862b6",
|
||||
"restore_container_id": "db6ae0750cc8",
|
||||
"fresh_restore_volume": "mtusi-lab2-restore_8e3b0298c2c4-data",
|
||||
"source_volume": [
|
||||
"mtusi-lab2_postgres_data"
|
||||
],
|
||||
"matching_counts": true,
|
||||
"matching_all_messages_sha256": true,
|
||||
"matching_selected_messages": true,
|
||||
"restored_snapshot": {
|
||||
"counts": {
|
||||
"users": 1,
|
||||
"chats": 10,
|
||||
"chat_members": 10,
|
||||
"messages": 100000,
|
||||
"sessions": 0
|
||||
},
|
||||
"messages_sha256": "3c38a0e32acafed71651826488fb514af7371e7d43bbfeb08f73aed17d68ea4f",
|
||||
"selected_messages": [
|
||||
{
|
||||
"id": "00000000-0000-0000-0000-000000000000",
|
||||
"chat_id": "12a8a7fe-93db-49a5-a5bf-f19f24392ffd",
|
||||
"sender_id": "538d79bc-a7f0-4e96-8698-4ab577ed37c9",
|
||||
"text": "\\x41004278787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878",
|
||||
"created_at": "2026-01-01T00:00:00+00:00"
|
||||
},
|
||||
{
|
||||
"id": "0000234c-4b36-4929-a3d8-31b88d3944ed",
|
||||
"chat_id": "12a8a7fe-93db-49a5-a5bf-f19f24392ffd",
|
||||
"sender_id": "538d79bc-a7f0-4e96-8698-4ab577ed37c9",
|
||||
"text": "\\x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878",
|
||||
"created_at": "2026-01-01T00:00:00.033386+00:00"
|
||||
},
|
||||
{
|
||||
"id": "801769f9-9185-4fef-996a-754fe04331e8",
|
||||
"chat_id": "5d7a1ad8-8b31-4976-971a-eee92058b8e1",
|
||||
"sender_id": "538d79bc-a7f0-4e96-8698-4ab577ed37c9",
|
||||
"text": "\\x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878",
|
||||
"created_at": "2026-01-01T00:00:00.002124+00:00"
|
||||
},
|
||||
{
|
||||
"id": "ffff5474-757f-457f-8bd5-894401da2910",
|
||||
"chat_id": "12a8a7fe-93db-49a5-a5bf-f19f24392ffd",
|
||||
"sender_id": "538d79bc-a7f0-4e96-8698-4ab577ed37c9",
|
||||
"text": "\\x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878",
|
||||
"created_at": "2026-01-01T00:00:00.059892+00:00"
|
||||
},
|
||||
{
|
||||
"id": "ffffa45b-75ea-4839-a5bd-fb0a85ba0d29",
|
||||
"chat_id": "12a8a7fe-93db-49a5-a5bf-f19f24392ffd",
|
||||
"sender_id": "538d79bc-a7f0-4e96-8698-4ab577ed37c9",
|
||||
"text": "\\x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878",
|
||||
"created_at": "2026-01-01T00:00:00.048116+00:00"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"messages": 100000,
|
||||
"nul_sample_verified": true
|
||||
},
|
||||
{
|
||||
"run": 2,
|
||||
"backup": {
|
||||
"format": "pg_dump custom",
|
||||
"bytes": 2654444,
|
||||
"dump_seconds": 0.303841,
|
||||
"bootstrap_seconds": 0.8235868330000002,
|
||||
"restore_seconds": 0.28861237500000003,
|
||||
"restored_database": "restore_dc75cd9655c0",
|
||||
"source_container_id": "07430ea862b6",
|
||||
"restore_container_id": "9a2e73441fcf",
|
||||
"fresh_restore_volume": "mtusi-lab2-restore_dc75cd9655c0-data",
|
||||
"source_volume": [
|
||||
"mtusi-lab2_postgres_data"
|
||||
],
|
||||
"matching_counts": true,
|
||||
"matching_all_messages_sha256": true,
|
||||
"matching_selected_messages": true,
|
||||
"restored_snapshot": {
|
||||
"counts": {
|
||||
"users": 1,
|
||||
"chats": 10,
|
||||
"chat_members": 10,
|
||||
"messages": 100000,
|
||||
"sessions": 0
|
||||
},
|
||||
"messages_sha256": "27b5a42196b56676462b626f38f28da114bcc7da0d4c584d4239e0286df4ab4b",
|
||||
"selected_messages": [
|
||||
{
|
||||
"id": "00000000-0000-0000-0000-000000000000",
|
||||
"chat_id": "a8efc6c4-bc38-4460-862a-01a5b31db242",
|
||||
"sender_id": "410288f9-4285-4b2c-9d5d-8ff651324300",
|
||||
"text": "\\x41004278787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878",
|
||||
"created_at": "2026-01-01T00:00:00+00:00"
|
||||
},
|
||||
{
|
||||
"id": "00003164-09c1-41f2-be94-4c59dac29663",
|
||||
"chat_id": "a8efc6c4-bc38-4460-862a-01a5b31db242",
|
||||
"sender_id": "410288f9-4285-4b2c-9d5d-8ff651324300",
|
||||
"text": "\\x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878",
|
||||
"created_at": "2026-01-01T00:00:00.048618+00:00"
|
||||
},
|
||||
{
|
||||
"id": "7f75439b-8443-451b-bd19-2fe5e0592b3b",
|
||||
"chat_id": "a8efc6c4-bc38-4460-862a-01a5b31db242",
|
||||
"sender_id": "410288f9-4285-4b2c-9d5d-8ff651324300",
|
||||
"text": "\\x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878",
|
||||
"created_at": "2026-01-01T00:00:00.013799+00:00"
|
||||
},
|
||||
{
|
||||
"id": "ffff6737-a2c0-479f-bc93-c68bdf9ceea7",
|
||||
"chat_id": "f7079b99-bdba-46ac-a651-1c2a451fcad2",
|
||||
"sender_id": "410288f9-4285-4b2c-9d5d-8ff651324300",
|
||||
"text": "\\x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878",
|
||||
"created_at": "2026-01-01T00:00:00.017859+00:00"
|
||||
},
|
||||
{
|
||||
"id": "ffffd4f9-50c9-4e50-a320-2b4afa0e0dec",
|
||||
"chat_id": "a8efc6c4-bc38-4460-862a-01a5b31db242",
|
||||
"sender_id": "410288f9-4285-4b2c-9d5d-8ff651324300",
|
||||
"text": "\\x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878",
|
||||
"created_at": "2026-01-01T00:00:00.068415+00:00"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"messages": 100000,
|
||||
"nul_sample_verified": true
|
||||
},
|
||||
{
|
||||
"run": 3,
|
||||
"backup": {
|
||||
"format": "pg_dump custom",
|
||||
"bytes": 2655198,
|
||||
"dump_seconds": 0.2799740420000001,
|
||||
"bootstrap_seconds": 0.8203773750000001,
|
||||
"restore_seconds": 0.266880542,
|
||||
"restored_database": "restore_4bc6680354a1",
|
||||
"source_container_id": "07430ea862b6",
|
||||
"restore_container_id": "aff2a0068a4c",
|
||||
"fresh_restore_volume": "mtusi-lab2-restore_4bc6680354a1-data",
|
||||
"source_volume": [
|
||||
"mtusi-lab2_postgres_data"
|
||||
],
|
||||
"matching_counts": true,
|
||||
"matching_all_messages_sha256": true,
|
||||
"matching_selected_messages": true,
|
||||
"restored_snapshot": {
|
||||
"counts": {
|
||||
"users": 1,
|
||||
"chats": 10,
|
||||
"chat_members": 10,
|
||||
"messages": 100000,
|
||||
"sessions": 0
|
||||
},
|
||||
"messages_sha256": "8c3e317ab75daa8a5e97641eac51e3a349cffe2293bb83bc2ba22ce602cbf112",
|
||||
"selected_messages": [
|
||||
{
|
||||
"id": "00000000-0000-0000-0000-000000000000",
|
||||
"chat_id": "16d5e714-6c35-4ad8-8e2f-b097a33a346a",
|
||||
"sender_id": "f34b3772-5504-4f6f-861b-f22d07f10181",
|
||||
"text": "\\x41004278787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878",
|
||||
"created_at": "2026-01-01T00:00:00+00:00"
|
||||
},
|
||||
{
|
||||
"id": "0000cf54-fd5c-4b78-9b83-5fdacc223d82",
|
||||
"chat_id": "16d5e714-6c35-4ad8-8e2f-b097a33a346a",
|
||||
"sender_id": "f34b3772-5504-4f6f-861b-f22d07f10181",
|
||||
"text": "\\x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878",
|
||||
"created_at": "2026-01-01T00:00:00.039523+00:00"
|
||||
},
|
||||
{
|
||||
"id": "7fc2eae6-055d-4a9d-b3b7-4e09c7d735ea",
|
||||
"chat_id": "16d5e714-6c35-4ad8-8e2f-b097a33a346a",
|
||||
"sender_id": "f34b3772-5504-4f6f-861b-f22d07f10181",
|
||||
"text": "\\x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878",
|
||||
"created_at": "2026-01-01T00:00:00.037757+00:00"
|
||||
},
|
||||
{
|
||||
"id": "fffe1a30-0346-4b72-b709-eb9c695c1993",
|
||||
"chat_id": "16d5e714-6c35-4ad8-8e2f-b097a33a346a",
|
||||
"sender_id": "f34b3772-5504-4f6f-861b-f22d07f10181",
|
||||
"text": "\\x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878",
|
||||
"created_at": "2026-01-01T00:00:00.040077+00:00"
|
||||
},
|
||||
{
|
||||
"id": "fffe9bca-2d05-4455-ab60-8d0d4d519df4",
|
||||
"chat_id": "16d5e714-6c35-4ad8-8e2f-b097a33a346a",
|
||||
"sender_id": "f34b3772-5504-4f6f-861b-f22d07f10181",
|
||||
"text": "\\x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878",
|
||||
"created_at": "2026-01-01T00:00:00.014042+00:00"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"messages": 100000,
|
||||
"nul_sample_verified": true
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,21 @@
|
||||
../.venv/bin/python scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
../.venv/bin/python scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
../.venv/bin/python tests/smoke.py --base-url "http://localhost:8080"
|
||||
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||
BASE_URL="http://localhost:8080" ../.venv/bin/python -m unittest discover -s student-tests -p test_api.py -v
|
||||
test_concurrent_messages_and_pagination (test_api.APIContract.test_concurrent_messages_and_pagination) ... ok
|
||||
test_cursor_scope_and_validation (test_api.APIContract.test_cursor_scope_and_validation) ... ok
|
||||
test_foreign_chat (test_api.APIContract.test_foreign_chat) ... ok
|
||||
test_invalid_chat_creation (test_api.APIContract.test_invalid_chat_creation) ... ok
|
||||
test_malformed_json_and_extra_fields (test_api.APIContract.test_malformed_json_and_extra_fields) ... ok
|
||||
test_registration_race (test_api.APIContract.test_registration_race) ... ok
|
||||
test_unicode_limits (test_api.APIContract.test_unicode_limits) ... ok
|
||||
test_unicode_nul_round_trip (test_api.APIContract.test_unicode_nul_round_trip) ... ok
|
||||
test_unicode_password_basic_and_logout (test_api.APIContract.test_unicode_password_basic_and_logout) ... ok
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Ran 9 tests in 2.631s
|
||||
|
||||
OK
|
||||
@@ -0,0 +1,7 @@
|
||||
Container mtusi-lab2-postgres-1 Restarting
|
||||
Container mtusi-lab2-redis-1 Restarting
|
||||
Container mtusi-lab2-api-1 Restarting
|
||||
Container mtusi-lab2-redis-1 Started
|
||||
Container mtusi-lab2-api-1 Started
|
||||
Container mtusi-lab2-postgres-1 Started
|
||||
PASS: U+0000 and literal backslash-u0000 preserved in display_name/title/text after API/PostgreSQL/Redis restart; original Bearer still valid.
|
||||
Reference in New Issue
Block a user