Files
mtusi2026lab4/evidence/criteria/safe-cleanup.md
T
2026-10-19 00:20:43 +03:00

49 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Grace period, блокировки, защита готовых объектов и повтор
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestAttachmentCleanupGraceLocksProtectionAndRetry`, `TestAttachmentCleanupInvalidKeyIsNeverDeleted`.
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](runs/20261018T203755.405686Z/backend.txt).
````text
=== RUN TestAttachmentCleanupGraceLocksProtectionAndRetry
--- PASS: TestAttachmentCleanupGraceLocksProtectionAndRetry (0.88s)
=== RUN TestAttachmentCleanupInvalidKeyIsNeverDeleted
--- PASS: TestAttachmentCleanupInvalidKeyIsNeverDeleted (0.61s)
PASS
````
## cleanup-dry-run
```sh
make attachments-cleanup
```
Начало: 2026-10-18T20:41:08.490906+00:00; длительность: 1.327 с; exit code: 0.
````text
docker compose --project-name highload-lab4 --env-file .env -f compose.yml run --rm --no-deps upload-cleanup ./messenger attachments-cleanup --dry-run
Container highload-lab4-upload-cleanup-run-ee9c8bded59f Creating
Container highload-lab4-upload-cleanup-run-ee9c8bded59f Created
{"direct":{"candidates":1,"deleted":0,"eligible":1,"protected":0,"skipped":0,"failed":0,"dry_run":true},"originals":{"candidates":0,"deleted":0,"eligible":0,"protected":0,"skipped":0,"failed":0,"dry_run":true}}
````
## Реализация
- [src/backend/cleanup.go](../../src/backend/cleanup.go)
- [src/backend/repositories/cleanup_config.go](../../src/backend/repositories/cleanup_config.go)
- [src/backend/repositories/upload.go](../../src/backend/repositories/upload.go)