forked from mtusi2026/mtusi2026lab4
The level 3 and 4 evidence was taken on24f9d61anda774a2f, before the lab 3 fixes were carried over and before the reconciler. Take all of it again in one series on81dd816, whose application and stand code is the final one: a fresh clone runs the launch block of the report from secrets to reset-data, then one stand from clean volumes gives the smoke, stack, limits, lb-check, failover of each replica and of the upload replica, persistence, S3 outage, S3 privacy, lost-answer retry, upload faults, all stack checks, storage layout and three runs of the upload memory matrix. The three memory runs keep the peak with three slots at 297-345 MiB against 512 MiB at the limit without them, but at 40 uploads of 10 MiB the wait for a slot nears the 8 s request timeout and one run of three gave 7 of 80 a 503. Those timeouts left 67 invisible intents; the record shows the reconciler seeing them as fresh and the sweep removing all of them after the grace period. Message write load is taken with tests/load.py from a container on the edge network: 2 106 RPS, no errors, replicas and PostgreSQL at their CPU limits. The first try from the macOS host is kept as a discarded attempt, it ran out of ephemeral ports while the replicas answered every request. The report gets the defense answers, the load section, the evidence commits, the upload limit order as the pipeline applies it, medians in the track 2 cost table and the proposals over the word limit; the evidence index lists every file with its command and commit. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27
107 lines
6.4 KiB
Plaintext
107 lines
6.4 KiB
Plaintext
date: 2026-10-30T04:31:11Z commit: 81dd816
|
||
$ make test-faults
|
||
BASE_URL="http://127.0.0.1:18084" .venv/bin/pytest -m stack -v -s student-tests/stack
|
||
============================= test session starts ==============================
|
||
platform darwin -- Python 3.14.5, pytest-9.1.1, pluggy-1.6.0 -- <repo>/.venv/bin/python
|
||
cachedir: .pytest_cache
|
||
rootdir: <repo>
|
||
configfile: pyproject.toml
|
||
plugins: asyncio-1.4.0, anyio-4.15.1
|
||
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function
|
||
collecting ... collected 17 items
|
||
|
||
student-tests/stack/test_attachment_faults.py::test_user_errors_never_become_500 10 MiB + 1 с Content-Length, тело не отправлено: 413
|
||
10 MiB + 1 chunked: 413
|
||
PNG 100000×100000 (бомба): 413
|
||
PNG 8001×5000: 413
|
||
обрезанный PNG: 415
|
||
обрезанный JPEG: 415
|
||
JPEG как image/png: 415
|
||
GIF как image/png: 415
|
||
WebP как image/png: 415
|
||
текст как image/png: 415
|
||
PNG как image/jpeg: 415
|
||
пустое тело: 415
|
||
application/octet-stream: 415
|
||
без Content-Type: 415
|
||
filename='../a.png': 400
|
||
filename='a/b.png': 400
|
||
filename='a\\b.png': 400
|
||
filename='a\x00.png': 400
|
||
filename='a\x01.png': 400
|
||
filename='a\x7f.png': 400
|
||
filename='': 400
|
||
filename=' ': 400
|
||
filename='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: 400
|
||
filename=None: 400
|
||
посторонний: upload в чужой чат: 404
|
||
посторонний: метаданные: 404
|
||
посторонний: /content: 404
|
||
посторонний: ссылка на чужое вложение: 404
|
||
вложение другого чата: 404
|
||
неизвестное вложение: 404
|
||
11 вложений: 400
|
||
повтор вложения: 400
|
||
невалидный UUID: 400
|
||
пустой текст без вложений: 400
|
||
невалидный id вложения: 400
|
||
variant=thumbnail: 400
|
||
строк вложений в чате: 2 (= ответов 201); ответов в журнале реплик: 54, из них 5xx: 0
|
||
PASSED
|
||
student-tests/stack/test_attachment_faults.py::test_commit_failure_is_compensated_at_once отказ COMMIT после записи объекта: 503 unavailable
|
||
сразу после ответа: строка нет, объект HEAD 404
|
||
журнал: audit.attachment_discarded reason=compensation
|
||
PASSED
|
||
student-tests/stack/test_attachment_faults.py::test_crash_between_put_and_commit_is_swept_after_grace реплика 899a952a5a21 убита между PUT и COMMIT, клиент получил 502
|
||
реплика 0cc3ee358e59 убита между PUT и COMMIT, клиент получил 502
|
||
остаток после падения: строка pending, объект HEAD 200
|
||
остаток после падения: строка pending, объект HEAD 200
|
||
старше grace: строка убрана через 26.2 с, объект HEAD 404
|
||
моложе grace: строка pending, объект HEAD 200
|
||
тот же после сдвига: убран через 1.0 с, объект HEAD 404
|
||
готовое вложение в сообщении со сдвинутым created_at скачивается, SHA-256 совпадает
|
||
PASSED
|
||
student-tests/stack/test_attachment_faults.py::test_aborted_upload_leaves_nothing обрыв после 256 KiB из 5 MiB: статус в журнале реплики [400], намерение None
|
||
PASSED
|
||
student-tests/stack/test_attachment_faults.py::test_stalled_upload_is_cut_and_leaves_nothing тело зависло после 1 KiB: 503 unavailable за 8.01 с
|
||
PASSED
|
||
student-tests/stack/test_faults.py::test_registration_race_yields_exactly_one_user гонка 50 регистраций: 201×1, 409×49
|
||
PASSED
|
||
student-tests/stack/test_faults.py::test_chat_creation_rolls_back_on_unknown_member чат с несуществующим участником: 400 invalid_request
|
||
PASSED
|
||
student-tests/stack/test_faults.py::test_wrong_password_and_unknown_user_get_same_basic_challenge неверный пароль: 401 за 0.011 с
|
||
неизвестный пользователь: 401 за 0.011 с
|
||
PASSED
|
||
student-tests/stack/test_faults.py::test_logout_then_token_is_dead logout: 204, затем 401, повтор 401
|
||
PASSED
|
||
student-tests/stack/test_faults.py::test_valkey_serves_repeated_checks 5 проверок токена: keyspace_hits 119 → 124
|
||
PASSED
|
||
student-tests/stack/test_faults.py::test_valkey_stopped_is_bypassed_but_logout_waits valkey остановлен, действующий токен: 200 за 0.004 с
|
||
valkey остановлен, неизвестный токен: 401 за 0.003 с
|
||
valkey остановлен: ready 200, вход 201, выход 503
|
||
valkey снова запущен: повторный выход 204
|
||
PASSED
|
||
student-tests/stack/test_faults.py::test_valkey_restart_keeps_cache_and_revocations рестарт valkey: ключей 45 → 45
|
||
рестарт valkey: живой 200, отозванный 401
|
||
PASSED
|
||
student-tests/stack/test_faults.py::test_valkey_flushall_loses_nothing FLUSHALL: живой 200, отозванный 401
|
||
PASSED
|
||
student-tests/stack/test_faults.py::test_postgres_stopped_gives_bounded_503_and_recovers postgres остановлен, ready: 503 за 0.004 с
|
||
postgres остановлен, me: 503 за 0.003 с
|
||
postgres остановлен, stranger: 503 за 0.002 с
|
||
postgres остановлен, login: 503 за 0.002 с
|
||
postgres остановлен, register: 503 за 0.015 с
|
||
live внутри реплики 200; LB исключил все реплики ещё через 1.16 с
|
||
live через LB без реплик: 503 за 0.000 с
|
||
postgres запущен: готовность через 1.6 с, прежний токен 200
|
||
PASSED
|
||
student-tests/stack/test_faults.py::test_api_restart_keeps_session_without_extending_it рестарт api: готовность через 2.3 с, токен 200
|
||
expires_at при входе 2026-10-30T05:32:12.249834Z, в БД после рестарта 2026-10-30T05:32:12.249834Z
|
||
PASSED
|
||
student-tests/stack/test_faults.py::test_full_restart_keeps_session_until_logout restart.sh: готовность через 0.0 с, прежний токен 200, выход 204, затем 401
|
||
PASSED
|
||
student-tests/stack/test_faults.py::test_session_expires_after_restart_at_original_time срок сессии сокращён до 20 с, рестарт api: готовность через 3.1 с, до срока 200, после срока 401
|
||
PASSED
|
||
|
||
======================== 17 passed in 98.43s (0:01:38) =========================
|