forked from mtusi2026/mtusi2026lab7
test: make the staging outage check independent of earlier mismatched rows
test_staging_cleanup_survives_outage relied on an empty cleaner queue, which the storage-consistency delta of track1-worker-compromise (decision 7) no longer provides: ready rows whose original does not match stay staging candidates on every pass, candidates go by (updated_at, id), and an S3 outage stops the pass at the first one. Age the test row by a day so it is the oldest candidate and drop the drain step; the scenario checks are unchanged. Record the red and green runs and the full failure_checks run in the track1 evidence, the per-pass re-read of mismatched originals in KNOWN_ISSUES and the report, and the decision in QUESTIONS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6100,6 +6100,12 @@ def wait_row_held(stand: Stand, attachment_id: str) -> None:
|
||||
time.sleep(0.1)
|
||||
|
||||
|
||||
# на сколько hook состаривает строку теста очистки при отказе S3: старше
|
||||
# любой строки прогона (стенд отказов — на своих volumes, прочие тесты
|
||||
# сдвигают строки не больше чем на AGED_S)
|
||||
STAGING_OLDEST_AGE_S = 24 * 3600
|
||||
|
||||
|
||||
@pytest.mark.spec("storage-consistency", "Очистка при отказе S3")
|
||||
def test_staging_cleanup_survives_outage(
|
||||
api: Api,
|
||||
@@ -6107,15 +6113,18 @@ def test_staging_cleanup_survives_outage(
|
||||
alice: Actor,
|
||||
chat: dict[str, Any],
|
||||
) -> None:
|
||||
"""Уборщик держит строку и ждёт DELETE в замороженном S3: отправка сообщения
|
||||
со ссылкой на вложение берёт `FOR KEY SHARE` и не ждёт его. Очередь уборщика
|
||||
сначала пуста: кандидаты идут от старых, и при замороженном S3 проход каждый раз
|
||||
прерывался бы на строке прежнего теста, не дойдя до этой."""
|
||||
drained = api.upload_ready(alice, chat["id"], images.sample_png())
|
||||
wait_staging_gone(stand, drained["id"])
|
||||
"""Уборщик держит строку и ждёт замороженный S3 (сверку оригинала перед
|
||||
DELETE): отправка сообщения со ссылкой на вложение берёт `FOR KEY SHARE` и
|
||||
не ждёт его. Кандидаты очистки идут по `(updated_at, id)`, и отказ S3
|
||||
прерывает проход на первом же. Пустой очереди уборщика не бывает: строки
|
||||
`ready` прежних тестов с несошедшимся оригиналом остаются кандидатами
|
||||
каждого прохода (сценарий «Результат не сходится с исходником», design
|
||||
change `track1-worker-compromise`, решение 7), и проход вставал бы на
|
||||
чужой строке. Поэтому строка теста — старейший кандидат (`age-row`)."""
|
||||
with outage(stand, "stop", "cleaner"):
|
||||
ready = api.upload_ready(alice, chat["id"], images.sample_png())
|
||||
assert ready["id"] in staged_ids(stand)
|
||||
stand("age-row", ready["id"], str(STAGING_OLDEST_AGE_S))
|
||||
stand("pause", "s3")
|
||||
try:
|
||||
for number in range(3):
|
||||
|
||||
Reference in New Issue
Block a user