Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cbe9d8748c | ||
|
|
b2bd7501d3 |
+19
-1
@@ -1,8 +1,8 @@
|
||||
.git
|
||||
.github
|
||||
.gitignore
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
secrets
|
||||
certs
|
||||
volumes
|
||||
@@ -17,4 +17,22 @@ backups
|
||||
__pycache__
|
||||
node_modules
|
||||
evidence
|
||||
examples
|
||||
scripts
|
||||
tests
|
||||
*.md
|
||||
Dockerfile*
|
||||
Makefile
|
||||
requirements-dev.txt
|
||||
lab.json
|
||||
.DS_Store
|
||||
|
||||
.idea
|
||||
.vscode
|
||||
.agents
|
||||
.codex
|
||||
|
||||
**/.env
|
||||
**/.env.*
|
||||
**/.idea
|
||||
**/.vscode
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS goose-builder
|
||||
RUN GOMAXPROCS=2 GOFLAGS=-p=1 GOBIN=/out CGO_ENABLED=0 go install \
|
||||
-tags='no_clickhouse no_libsql no_mssql no_mysql no_sqlite3 no_vertica no_ydb no_spanner' \
|
||||
github.com/pressly/goose/v3/cmd/goose@v3.27.1
|
||||
|
||||
FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616 AS migrations
|
||||
COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
COPY migrations /migrations
|
||||
COPY infra/migrate.sh /usr/local/bin/migrate
|
||||
USER 10001:10001
|
||||
ENTRYPOINT ["/usr/local/bin/migrate"]
|
||||
CMD ["up"]
|
||||
|
||||
FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS builder
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
RUN apk add --no-cache gcc musl-dev
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY cmd ./cmd
|
||||
COPY contracts ./contracts
|
||||
COPY dto ./dto
|
||||
COPY internal ./internal
|
||||
COPY migrations ./migrations
|
||||
ENV GOFLAGS=-p=1 GOMAXPROCS=2
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build \
|
||||
-trimpath \
|
||||
-ldflags="-s -w" \
|
||||
-o /out/messenger ./cmd
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/reconcile ./cmd/reconcile
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/worker ./cmd/worker
|
||||
|
||||
FROM builder AS tests
|
||||
COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
ENV GOOSE_MIGRATION_DIR=/src/migrations
|
||||
CMD ["go", "test", "-p=1", "-race", "-count=1", "-v", "./..."]
|
||||
|
||||
FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616
|
||||
|
||||
RUN apk add --no-cache libwebp-tools=1.6.0-r0
|
||||
|
||||
RUN addgroup -S messenger \
|
||||
&& adduser -S -D -H -u 10001 -G messenger messenger
|
||||
|
||||
COPY --from=builder --chown=messenger:messenger /out/messenger /usr/local/bin/messenger
|
||||
|
||||
COPY --from=builder --chown=messenger:messenger /out/reconcile /usr/local/bin/reconcile
|
||||
|
||||
COPY --from=builder --chown=messenger:messenger /out/worker /usr/local/bin/worker
|
||||
|
||||
ENV PORT=8080
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
USER messenger:messenger
|
||||
|
||||
HEALTHCHECK --interval=10s --timeout=3s --start-period=3s --retries=3 \
|
||||
CMD wget -q -O /dev/null "http://127.0.0.1:${PORT}/health/ready" || exit 1
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/messenger"]
|
||||
@@ -0,0 +1,34 @@
|
||||
FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS minio-builder
|
||||
ADD --checksum=sha256:8b11129f6a6830768bcdebab569290ad956618f5ff6ef4857b633acb64f95126 https://codeload.github.com/minio/minio/tar.gz/01ce918d8279a20e4706b96a64396146894adee4 /tmp/source.tar.gz
|
||||
RUN mkdir /src && tar -xzf /tmp/source.tar.gz -C /src --strip-components=1
|
||||
WORKDIR /src
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /out/minio .
|
||||
RUN echo '8b11129f6a6830768bcdebab569290ad956618f5ff6ef4857b633acb64f95126 /tmp/source.tar.gz' | sha256sum -c -
|
||||
|
||||
FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS mc-builder
|
||||
ADD --checksum=sha256:4cea8ed209c8f96e59ea1a5cc4901019b54c2be6d6f5f16c6749ea8bdcf4172e https://codeload.github.com/minio/mc/tar.gz/d6541ea280b73a834b64d4097e21f2be77676104 /tmp/source.tar.gz
|
||||
RUN mkdir /src && tar -xzf /tmp/source.tar.gz -C /src --strip-components=1
|
||||
WORKDIR /src
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /out/mc .
|
||||
RUN echo '4cea8ed209c8f96e59ea1a5cc4901019b54c2be6d6f5f16c6749ea8bdcf4172e /tmp/source.tar.gz' | sha256sum -c -
|
||||
|
||||
FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616 AS minio
|
||||
LABEL org.opencontainers.image.source="https://github.com/minio/minio" \
|
||||
org.opencontainers.image.revision="01ce918d8279a20e4706b96a64396146894adee4" \
|
||||
org.opencontainers.image.version="RELEASE.2025-09-07T16-13-09Z" \
|
||||
org.opencontainers.image.licenses="AGPL-3.0"
|
||||
RUN mkdir /data && chown 10001:10001 /data
|
||||
COPY --from=minio-builder /out/minio /usr/local/bin/minio
|
||||
COPY infra/minio-entrypoint.sh /usr/local/bin/start-minio
|
||||
USER 10001:10001
|
||||
EXPOSE 9000
|
||||
ENTRYPOINT ["/usr/local/bin/start-minio"]
|
||||
|
||||
FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616 AS mc
|
||||
LABEL org.opencontainers.image.source="https://github.com/minio/mc" \
|
||||
org.opencontainers.image.revision="d6541ea280b73a834b64d4097e21f2be77676104" \
|
||||
org.opencontainers.image.version="RELEASE.2025-08-13T08-35-41Z" \
|
||||
org.opencontainers.image.licenses="AGPL-3.0"
|
||||
COPY --from=mc-builder /out/mc /usr/local/bin/mc
|
||||
USER 10001:10001
|
||||
ENTRYPOINT ["mc"]
|
||||
@@ -1,13 +1,21 @@
|
||||
PYTHON ?= python3
|
||||
BASE_URL ?= http://localhost:8080
|
||||
PYTHON ?= $(if $(wildcard .venv/bin/python),.venv/bin/python,python3)
|
||||
GO ?= go
|
||||
PORT ?= 18085
|
||||
BASE_URL ?= http://localhost:$(PORT)
|
||||
IMAGE ?= mtusi-messenger:lab5
|
||||
CA_FILE ?=
|
||||
ACTION_SCRIPT ?=
|
||||
ACTION_SCRIPT ?= scripts/restart.sh
|
||||
FAILOVER_SCRIPT ?= scripts/stop-one.sh
|
||||
RECONCILE_ARGS ?=
|
||||
export PYTHONDONTWRITEBYTECODE=1
|
||||
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
|
||||
|
||||
.PHONY: help check validate test load test-persistence test-failover
|
||||
.PHONY: help run docker-build docker-run check validate test test-own test-all load test-persistence bootstrap up down migrate test-integration test-grade4 test-lab4 test-reconcile measure-uploads measure-load migrate-status rolling-update test-failover wait bootstrap-s3 reconcile reconcile-apply
|
||||
|
||||
export PORT BASE_URL
|
||||
|
||||
help:
|
||||
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
|
||||
@echo "up: build and deploy isolated lab5 stack; test-lab5: pipeline faults; benchmark: queue research; down: keep volumes; test-integration: PostgreSQL race/rollback/EXPLAIN; test-grade4: cross-replica idempotency, both failures and rolling update; check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
|
||||
|
||||
check:
|
||||
$(PYTHON) scripts/check_contract.py
|
||||
@@ -18,6 +26,11 @@ validate:
|
||||
test:
|
||||
$(PYTHON) tests/smoke.py --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
test-own:
|
||||
$(GO) test -race ./...
|
||||
|
||||
test-all: check validate test-own
|
||||
|
||||
load:
|
||||
$(PYTHON) tests/load.py --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
@@ -25,6 +38,82 @@ test-persistence:
|
||||
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable restart hook"; exit 2)
|
||||
$(PYTHON) tests/resilience.py --mode persistence --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
bootstrap:
|
||||
./scripts/bootstrap.sh
|
||||
|
||||
up:
|
||||
$(PYTHON) scripts/swarm.py up
|
||||
|
||||
down:
|
||||
$(PYTHON) scripts/swarm.py down
|
||||
|
||||
migrate:
|
||||
$(PYTHON) scripts/swarm.py migrate
|
||||
|
||||
migrate-status:
|
||||
$(PYTHON) scripts/swarm.py migrate-status
|
||||
|
||||
rolling-update:
|
||||
$(PYTHON) scripts/swarm.py update
|
||||
|
||||
run:
|
||||
PORT="$(PORT)" $(GO) run ./cmd
|
||||
|
||||
docker-build:
|
||||
docker build -t "$(IMAGE)" .
|
||||
|
||||
test-integration:
|
||||
$(PYTHON) scripts/swarm.py test-integration
|
||||
|
||||
test-grade4:
|
||||
$(PYTHON) tests/own/swarm_grade4.py
|
||||
|
||||
test-lab4:
|
||||
$(PYTHON) tests/own/lab5.py
|
||||
|
||||
test-reconcile:
|
||||
$(PYTHON) tests/own/lab5.py
|
||||
|
||||
measure-uploads:
|
||||
$(PYTHON) scripts/measure_uploads.py
|
||||
|
||||
bootstrap-s3:
|
||||
$(PYTHON) scripts/swarm.py bootstrap-s3
|
||||
|
||||
reconcile:
|
||||
$(PYTHON) scripts/swarm.py reconcile $(RECONCILE_ARGS)
|
||||
|
||||
reconcile-apply:
|
||||
$(PYTHON) scripts/swarm.py reconcile --apply $(RECONCILE_ARGS)
|
||||
|
||||
measure-load:
|
||||
$(PYTHON) scripts/measure_load.py --base-url "$(BASE_URL)"
|
||||
|
||||
test-failover:
|
||||
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable stop-one hook"; exit 2)
|
||||
$(PYTHON) tests/resilience.py --mode failover --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
$(PYTHON) tests/resilience.py --mode failover --action-script "$(if $(filter command line,$(origin ACTION_SCRIPT)),$(ACTION_SCRIPT),$(FAILOVER_SCRIPT))" --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
wait:
|
||||
$(PYTHON) scripts/swarm.py wait
|
||||
|
||||
.PHONY: test-lab5 benchmark plot-research worker-stop worker-start
|
||||
test-lab5:
|
||||
$(PYTHON) tests/own/lab5.py
|
||||
|
||||
benchmark:
|
||||
$(PYTHON) scripts/benchmark_pipeline.py --base-url "$(BASE_URL)"
|
||||
|
||||
plot-research:
|
||||
$(PYTHON) scripts/plot_pipeline.py
|
||||
|
||||
worker-stop:
|
||||
$(PYTHON) scripts/swarm.py worker-stop
|
||||
|
||||
worker-start:
|
||||
$(PYTHON) scripts/swarm.py worker-start
|
||||
|
||||
.PHONY: failed-jobs replay
|
||||
failed-jobs:
|
||||
$(PYTHON) scripts/swarm.py failed-jobs
|
||||
|
||||
replay:
|
||||
$(PYTHON) scripts/swarm.py replay --replay "$(JOB_ID)" --operator "$(OPERATOR)" --reason "$(REASON)"
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
# Переход с lab4 на lab5
|
||||
|
||||
Исходный проект `mtusi2026lab4` сохранён без изменений.
|
||||
Go module path сохранён для существующих импортов.
|
||||
Нормативные контракты и публичные проверки lab5 восстановлены из исходного skeleton.
|
||||
|
||||
Загрузка теперь возвращает `202 queued` после staging PUT и PostgreSQL COMMIT.
|
||||
Старая строка ready без вариантов проходит backfill 009 и получает все три варианта.
|
||||
При обновлении `make up` останавливает только API своего стека перед backfill.
|
||||
Это исключает запись старым процессом после миграции.
|
||||
Volumes и Docker secrets сохраняются.
|
||||
|
||||
Стек, образы и секреты используют имена lab5. Внешний порт по умолчанию — 18085.
|
||||
Стенд lab4 на 8080 не изменяется.
|
||||
Redis хранит сессии и durable Streams в одном AOF volume.
|
||||
Worker работает отдельным сервисом; API не выполняет resize.
|
||||
|
||||
Новая схема, команды и проверки описаны в [REPORT.md](REPORT.md).
|
||||
Старые `evidence/lab4-*` относятся к исходному проекту и не доказывают выполнение lab5.
|
||||
@@ -2,7 +2,13 @@
|
||||
|
||||
Отделить приём файла от тяжёлой обработки, корректно переживать повторную доставку и остановку worker.
|
||||
|
||||
Это **skeleton**, а не готовый сервер. Здесь есть задание, контракт и публичные проверки. Реализацию приложения, Dockerfile и требуемую инфраструктуру пишет студент. Язык и framework свободные; UI не обязателен.
|
||||
Реализация использует Redis Streams, PostgreSQL outbox и отдельный worker.
|
||||
API сохраняет оригинал в приватный MinIO staging и возвращает `202 queued`.
|
||||
Worker создаёт JPEG thumbnail, JPEG crop и WebP optimized.
|
||||
Запуск: `make up`; адрес: http://localhost:18085; Swagger: `/swagger/`.
|
||||
Проверки: `make test`, `make test-integration`, `make test-lab5`.
|
||||
Инструкции и доказательства находятся в [REPORT.md](REPORT.md).
|
||||
Исследование перегрузки описано в [RESEARCH.md](RESEARCH.md).
|
||||
|
||||
[Карта курса](COURSE.md) · [Процесс fork/PR](CONTRIBUTING.md) · [OpenAPI](contracts/openapi.json) · [Семантика API](contracts/README.md) · [Проверки](tests/README.md) · [Отчёт](REPORT.md) · [Примеры JSON](contracts/examples.json) · [Памятка преподавателю](MAINTAINERS.md)
|
||||
|
||||
@@ -52,16 +58,17 @@
|
||||
make check
|
||||
|
||||
# После реализации запустите свой сервер/стенд по REPORT.md.
|
||||
# По умолчанию тест использует http://localhost:8080.
|
||||
# По умолчанию Makefile использует http://localhost:18085.
|
||||
make test
|
||||
```
|
||||
|
||||
`.env.example`, `compose.example.yaml` и `contracts/infrastructure.json` описывают настройки и роли компонентов. **compose.example.yaml — список ролей с пустым services, не запускаемый стенд.** Реализуйте свой `compose.yaml`/`stack.yaml`, закрепите версии образов, заполните локальный `.env` и опишите bootstrap/миграции. Все зависимости поднимаются из этого репозитория; ссылка «у меня БД уже установлена» не заменяет воспроизводимость.
|
||||
`compose.yaml` и `stack.yaml` запускают готовый стенд с закреплёнными версиями образов. Роли компонентов описаны в `contracts/infrastructure.json`. `make bootstrap` создаёт секреты в исключённом из Git каталоге `secrets/`; Swarm использует Docker secrets. Миграции выполняются перед запуском API. Все зависимости поднимаются из этого репозитория. Порядок запуска описан в [REPORT.md](REPORT.md).
|
||||
|
||||
```sh
|
||||
# Compose-вариант после реализации:
|
||||
docker compose --env-file .env config --quiet
|
||||
docker compose --env-file .env up -d --build
|
||||
./scripts/compose.sh config --quiet
|
||||
make bootstrap
|
||||
./scripts/compose.sh up -d --build --wait
|
||||
# Дождитесь /health/ready; затем make test.
|
||||
# Для Swarm укажите эквивалентные build/push/deploy-команды в REPORT.md.
|
||||
```
|
||||
|
||||
@@ -1,37 +1,268 @@
|
||||
# Отчёт — лабораторная 5
|
||||
# Лабораторная 5: очередь изображений
|
||||
|
||||
- Автор, группа: TODO
|
||||
- Целевая оценка; выбранный трек 5, если нужен: TODO
|
||||
- Commit/PR: TODO после публикации
|
||||
- Использованные источники, библиотеки и помощь ИИ: TODO
|
||||
Целевая оценка: **5**, исследование — **трек 1, очередь под перегрузкой**.
|
||||
Redis уже хранит сессии. Redis Streams добавляет очередь без второго брокера.
|
||||
Исследование сравнивает три настройки concurrency/prefetch. Методика и результаты: [RESEARCH.md](RESEARCH.md).
|
||||
Публичные контракты и проверки lab5 сохранены.
|
||||
|
||||
## Запуск из чистого clone
|
||||
## Запуск
|
||||
|
||||
TODO: версии runtime/образов, prerequisites, команды создания локальных secrets/.env, build, миграций, запуска, ожидания готовности, тестов и остановки. Указать необходимые действия оператора. Не вставлять секреты. Отдельно указать безопасную остановку и команду намеренного удаления учебных данных.
|
||||
Установите Docker с поддержкой Swarm и Python 3.9+.
|
||||
Локальные Go-проверки требуют Go 1.26.4 или новее.
|
||||
Запустите стенд:
|
||||
|
||||
## Архитектура и решения
|
||||
```sh
|
||||
make up
|
||||
make wait
|
||||
make test
|
||||
```
|
||||
|
||||
TODO: схема процессов/хранилищ, источник истины, транзакционные границы, ограничения. Что перенесено из lab4, что изменено в этой работе. Соответствие переменных из .env.example реальной конфигурации.
|
||||
API: http://localhost:18085. Swagger: http://localhost:18085/swagger/.
|
||||
Стек `mtusi-lab5` не использует volumes, секреты и порт исходного стенда lab4.
|
||||
Скрипт поддерживает один узел Swarm. Порты хранилищ не опубликованы.
|
||||
|
||||
## Доказательства критериев
|
||||
Bootstrap создаёт случайные секреты в локальном каталоге `secrets/` и Docker secrets.
|
||||
Каталог исключён из Git и Docker context. Скрипты не загружают `.env`.
|
||||
Версии закреплены в Dockerfile/stack.yaml:
|
||||
|
||||
| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства |
|
||||
| --- | --- | --- | --- |
|
||||
| Публичный smoke | make test | TODO | TODO |
|
||||
| Остальные пункты уровня 3 | TODO | TODO | TODO |
|
||||
| Все пункты уровня 4, если заявлен | TODO | TODO | TODO |
|
||||
| Выбранный трек 5, если заявлен | TODO | TODO | TODO |
|
||||
| Компонент | Версия |
|
||||
| --- | --- |
|
||||
| Go / Alpine | 1.26.4 / 3.23, базовые digest в Dockerfile |
|
||||
| PostgreSQL | 17.6-alpine3.22 |
|
||||
| Redis | 7.4.5-alpine3.21 |
|
||||
| HAProxy | 3.2.6-alpine |
|
||||
| MinIO | RELEASE.2025-09-07T16-13-09Z, фиксированный commit и SHA-256 |
|
||||
| mc | RELEASE.2025-08-13T08-35-41Z, фиксированный commit и SHA-256 |
|
||||
| libwebp-tools | 1.6.0-r0 |
|
||||
|
||||
TODO: добавить отдельную строку для каждого заявленного критерия. PASS без команды и наблюдения не является доказательством. Проверка инфраструктурного hook требует подтверждения, какие реальные процессы/хранилища перезапущены.
|
||||
Go compiler использует `-p=1` и `GOMAXPROCS=2` при сборке контейнеров.
|
||||
Это ограничивает память сборки на Docker VM с 1,91GiB RAM.
|
||||
Первый параллельный build получил OOM; последовательный build устранил эту ошибку.
|
||||
`SKIP_STORAGE_BUILD=1 make up` повторно использует уже собранные образы MinIO/mc.
|
||||
Обычный `make up` собирает все образы из репозитория.
|
||||
|
||||
## Эксперименты и отказы
|
||||
Compose запускает те же роли с одной API-репликой:
|
||||
|
||||
TODO: гипотеза, hardware/лимиты, версии, объём данных, профиль нагрузки, concurrency/arrival rate, длительность/прогрев, повторы, успешные RPS, ошибки, p50/p95/p99, CPU/RAM. Сохранить raw summary без tokens и объяснить ограничения измерения.
|
||||
```sh
|
||||
make bootstrap
|
||||
./scripts/compose.sh up -d --build --wait
|
||||
make test
|
||||
./scripts/compose.sh down
|
||||
```
|
||||
|
||||
| Воздействие | Что ожидаем | Что наблюдали | Время восстановления / потеря данных |
|
||||
| --- | --- | --- | --- |
|
||||
| TODO | TODO | TODO | TODO |
|
||||
Остановите один стенд перед запуском другого на том же порту.
|
||||
`make down` сохраняет volumes и Docker secrets.
|
||||
При обновлении `make up` останавливает API перед миграциями 005–010.
|
||||
Миграция 009 переводит старые ready-оригиналы lab4 в очередь без повторной загрузки.
|
||||
Старый object key временно становится staging key.
|
||||
Worker удаляет этот staging только после публикации готовых вариантов.
|
||||
Эта пауза исключает запись старой API-версией после backfill.
|
||||
Откат миграций удаляет jobs/outbox; сохранять принятые задачи при downgrade нельзя.
|
||||
|
||||
## Ограничения и следующие шаги
|
||||
## Путь принятой загрузки
|
||||
|
||||
TODO: какие отказы выдерживаются и какие нет; что не реализовано; где учебное упрощение; какое улучшение подтверждено, а какое пока гипотеза.
|
||||
1. API проверяет сессию, членство в чате, имя, bytes, MIME и пиксели.
|
||||
2. API сохраняет проверенный оригинал в приватный `staging/<attachment_id>`.
|
||||
3. PostgreSQL одной транзакцией сохраняет attachment, job и outbox.
|
||||
4. API возвращает `202` со снимком `queued` после COMMIT.
|
||||
5. Publisher читает outbox через `FOR UPDATE SKIP LOCKED` и делает XADD.
|
||||
6. Worker получает сообщение через XREADGROUP и арендует job в PostgreSQL.
|
||||
7. Renderer создаёт варианты в отдельном процессе с deadline.
|
||||
8. Worker сохраняет оригинал и три варианта по постоянным versioned keys.
|
||||
9. PostgreSQL атомарно публикует ready и метаданные всех вариантов.
|
||||
10. Worker подтверждает запись через XACK и удаляет подтверждённую запись XDEL.
|
||||
|
||||
API не выполняет resize. Проверка входного изображения в API сохраняет требования lab4.
|
||||
Она включает полный decode для обнаружения повреждений, но не создаёт варианты.
|
||||
Каждая API-реплика проверяет не более одного upload одновременно.
|
||||
Локальный spool ограничен 10MiB и удаляется после staging PUT или ошибки.
|
||||
|
||||
API publisher работает независимо от worker. Worker также может опубликовать ожидающий outbox.
|
||||
Row locks исключают конкурентную публикацию одной outbox-строки.
|
||||
Разрыв между XADD и PostgreSQL COMMIT может создать дубль; потеря принятой задачи не возникает.
|
||||
Подтверждение XADD означает durable запись Redis с `appendfsync always`.
|
||||
XACK означает устойчивый результат обработки либо устойчивую запись следующего состояния.
|
||||
Это at-least-once доставка с идемпотентным эффектом, а не exactly-once доставка.
|
||||
|
||||
Redis хранит stream `attachments:jobs:v1`, группа — `image-workers-v1`.
|
||||
Одно поле stream `job` содержит JSON по `contracts/jobs.schema.json`.
|
||||
Поля включают UUID job/attachment, version, attempt, type, schema_version и created_at.
|
||||
Сообщение не содержит bytes, credentials, filename, URL или S3 key.
|
||||
Worker берёт доверенные storage metadata из PostgreSQL.
|
||||
|
||||
## Состояния, retry и защита результата
|
||||
|
||||
PostgreSQL — источник истины состояний queued/processing/ready/failed.
|
||||
Queued и processing можно прикрепить к сообщению своего чата.
|
||||
Content до ready и после failed возвращает 409. Метаданные доступны во всех состояниях.
|
||||
Failed нельзя прикрепить заново. Ранее подтверждённые сообщения и их idempotency replay сохраняются.
|
||||
|
||||
Claim увеличивает attempts и fence, задаёт lease_until.
|
||||
Фиксация результата требует текущий fence, pipeline_version и ещё действующий lease.
|
||||
Она также требует ровно одну изменённую строку attachment нужной версии и состояния.
|
||||
Старый процесс не публикует ready после аренды новой попыткой.
|
||||
Объекты используют ключ `original/<attachment_id>/v<pipeline_version>/<variant>`.
|
||||
Имена эффектов: original, thumbnail, crop, optimized.
|
||||
Повтор той же версии пишет те же байты в те же четыре ключа.
|
||||
Новая версия получает другой prefix. Стандартный pipeline_version равен 1.
|
||||
|
||||
XAUTOCLAIM возвращает pending-доставки умерших consumers после lease.
|
||||
Истёкший processing возвращается в queued через устойчивую транзакцию и новый outbox.
|
||||
Attempts учитывают управляемые попытки обработки; простой дубль ready не увеличивает attempts.
|
||||
Перед ack дубля ready проверяются метаданные и наличие четырёх S3-объектов нужного размера.
|
||||
Дубль не изменяет updated_at, варианты или готовый результат.
|
||||
|
||||
Временные ошибки хранилищ, timeout и worker crash используют ограниченный retry.
|
||||
Постоянные ошибки изображения и исчезнувший staging дают failed сразу.
|
||||
Backoff после попытки n: `2^min(n,5)` секунд плюс случайные 0–499ms.
|
||||
По умолчанию разрешено пять попыток. Финальный public error_code безопасен и не содержит внутренних данных.
|
||||
Реестр failed хранится в attachment_jobs; последняя причина сохраняется в last_error.
|
||||
|
||||
```sh
|
||||
make failed-jobs
|
||||
make replay JOB_ID=<uuid> OPERATOR=<name> REASON='Причина повторной обработки'
|
||||
```
|
||||
|
||||
Replay принимает только failed с доступным staging и свободным admission slot.
|
||||
Он сохраняет job_id и versioned effect identity, сбрасывает счётчик попыток и увеличивает fence.
|
||||
Транзакция записывает operator, reason, предыдущую ошибку и время в attachment_replays.
|
||||
Replay ready или ещё активной работы отклоняется. После истечения retention replay отклоняется.
|
||||
|
||||
## Изображения и пределы ресурсов
|
||||
|
||||
Thumbnail — JPEG quality85, вписан в 256×256 без увеличения, размеры округляются вниз.
|
||||
Crop — центрированный квадрат JPEG128×128 quality85, малые исходники увеличиваются.
|
||||
Optimized — WebP quality80, method4, вписан в 1280×1280 без увеличения.
|
||||
JPEG/PNG EXIF orientation1–8 применяется до изменения размеров.
|
||||
Alpha компонуется на белый. Варианты не сохраняют EXIF; cwebp получает `-metadata none`.
|
||||
Уменьшение каждого маленького файла не обещается. Оригинал сохраняется побайтно.
|
||||
|
||||
API ограничивает bytes10MiB и 40 миллионов пикселей до полного decode.
|
||||
Worker повторно проверяет размер, SHA-256, DecodeConfig и pixel budget.
|
||||
Resize/decode/cwebp работают в дочернем renderer; CommandContext ограничивает весь процесс.
|
||||
Renderer создаёт отдельную process group. Deadline убивает renderer и потомков, включая cwebp.
|
||||
Общий pixel semaphore ограничивает одновременно распакованные исходники 40Mpx на worker service.
|
||||
Orientation использует представление исходника, без второй копии полного изображения.
|
||||
Renderer получает GOMEMLIMIT384MiB; worker service ограничен cgroup1536MiB и1CPU.
|
||||
GOMEMLIMIT является мягким Go-лимитом; жёсткий предел задаёт cgroup всей службы.
|
||||
|
||||
| Настройка | По умолчанию | Назначение |
|
||||
| --- | --- | --- |
|
||||
| WORKER_CONCURRENCY | 2 | Одновременные обработки, максимум8 |
|
||||
| WORKER_PREFETCH | 4 | Ёмкость локальной очереди, максимум32 |
|
||||
| WORKER_TIMEOUT_SECONDS | 25 | Вся попытка: admission пикселей, download, renderer и PUT |
|
||||
| WORKER_LEASE_SECONDS | 40 | Lease; минимум timeout+5s |
|
||||
| WORKER_PIXEL_BUDGET | 40000000 | Общий pixel budget, максимум80000000 |
|
||||
| WORKER_MAX_ATTEMPTS | 5 | Число попыток новой job, задаётся API при upload |
|
||||
| MAX_OUTSTANDING_JOBS | 200 | Максимум queued+processing на весь стенд |
|
||||
|
||||
Prefetch ограничивает ожидающую локальную очередь. Активные процессы добавляют concurrency к числу полученных сообщений.
|
||||
Настройки bounded; число принятых незавершённых jobs ограничено отдельно.
|
||||
Admission использует общий PostgreSQL advisory lock и count queued/processing.
|
||||
Этот lock также защищает replay. Превышение возвращает 429 с Retry-After.
|
||||
Проверка и вставка выполняются в одной транзакции, поэтому две API-реплики не превышают лимит.
|
||||
Lock удерживается во время staging PUT. Это ограничивает throughput upload и измеряется в исследовании.
|
||||
|
||||
## Retention и согласованность S3
|
||||
|
||||
Очистка выполняется каждые пять секунд, не более100 metadata rows за проход.
|
||||
Ready staging удаляется после устойчивой публикации всех вариантов.
|
||||
Failed staging и частичные конечные объекты сохраняются семь дней для расследования и replay.
|
||||
После семи дней cleanup удаляет bytes и ставит storage_cleaned_at, но сохраняет metadata/job/audit.
|
||||
Replay и cleanup блокируют одну metadata row; очистка не удаляет текущую работу.
|
||||
Старый stage без metadata имеет grace90s и общий с upload advisory lock.
|
||||
После PUT без COMMIT API возвращает ошибку; такой stage удаляется после grace.
|
||||
Готовые конечные вложения сохраняются бессрочно, включая ещё не привязанные к сообщению.
|
||||
Их staging очищается одинаково. Автоматическое удаление готовых конечных вложений не реализовано.
|
||||
|
||||
Reconciler lab4 сохранён: `make reconcile`, `make reconcile-apply`.
|
||||
Он защищает текущий versioned prefix и staging_key, включая legacy staging в original-prefix.
|
||||
Отсутствующий ready-оригинал атомарно переводит attachment и job в failed.
|
||||
Reconciler не удаляет ссылки из подтверждённых сообщений.
|
||||
Reconciler контролирует original; внешняя утрата отдельного варианта требует ручного восстановления.
|
||||
Проверка дубля пишет безопасный retry-log, если готовый эффект недоступен.
|
||||
Автоматический ремонт внешних удалений вариантов не реализован.
|
||||
|
||||
## Проверки и исследование
|
||||
|
||||
Подготовьте зависимости проверок:
|
||||
|
||||
```sh
|
||||
python3 -m venv .venv
|
||||
.venv/bin/python -m pip install -r requirements-dev.txt -r requirements-research.txt
|
||||
make check validate
|
||||
make test-own
|
||||
make test-integration
|
||||
make test
|
||||
make test-lab5
|
||||
make test-persistence
|
||||
make test-failover
|
||||
make benchmark
|
||||
make plot-research
|
||||
```
|
||||
|
||||
Go-тесты проверяют геометрию, EXIF1–8, alpha, повреждения, MIME, concurrency и транзакции.
|
||||
Интеграционный тест проверяет stale/expired fence и защиту более новой pipeline_version.
|
||||
Fault suite внедряет ошибку после staging, разрыв COMMIT/publish и два broker restart.
|
||||
Он останавливает worker после S3 effects и после result COMMIT перед ack.
|
||||
Проверяются повторная доставка, lease recovery, bounded retry, permanent failure и audit replay.
|
||||
Отдельный renderer_timeout блокирует настоящий cwebp на FIFO и проверяет уничтожение потомков.
|
||||
Очистка проверяется для ready, unconfirmed и expired failed staging.
|
||||
Все пользователи и изображения синтетические. Токены и секреты в evidence не сохраняются.
|
||||
Запускайте fault, persistence и benchmark последовательно на учебном стенде.
|
||||
|
||||
Исследование трека1 использует реальные свежие измерения, а не результаты исходного проекта.
|
||||
Пары concurrency/prefetch: (1,1), (2,4), (4,8); размеры PNG512² и1536².
|
||||
Отдельный опыт проверяет предел admission при остановленном worker и последующее восстановление.
|
||||
Raw данные, графики, ограничения методики и объяснение для защиты находятся в [RESEARCH.md](RESEARCH.md).
|
||||
Исследование завершено: все 120 измеряемых загрузок стали ready, шесть сочетаний настроек и размеров проверены.
|
||||
Пара concurrency=2, prefetch=4 дала лучший throughput для обоих размеров: 4,013 и 0,851 изображения/с.
|
||||
При остановленном worker лимит 8 принял 8 из 16 загрузок; остальные получили 429.
|
||||
После запуска все 8 заданий завершились, очередь опустела, новая загрузка прошла.
|
||||
Текстовое сообщение сохранилось при полной очереди. Исходные настройки восстановлены.
|
||||
Итог `PASS` и наблюдения: `evidence/lab5-research.json`; таблица: `evidence/lab5-research.csv`.
|
||||
Исторические evidence/lab4-* не считаются доказательством lab5.
|
||||
|
||||
`make test` прошёл на новом API lab5. Журнал: `evidence/lab5-smoke.txt`.
|
||||
Host race-тесты и контейнерные интеграционные тесты прошли.
|
||||
Интеграционный журнал: `evidence/lab5-integration.txt`; исходная ошибка fixture сохранена отдельно.
|
||||
Прежний fixture удалял migration journal из уже обновлённой схемы.
|
||||
Теперь он сначала возвращает физическую схему lab4, затем проверяет её импорт.
|
||||
|
||||
Все обязательные fault cases проверены на реальных PostgreSQL, Redis Streams и MinIO.
|
||||
Первый полный вызов подтвердил основные durability/crash/retry сценарии и выявил гонку тестового stop helper.
|
||||
Desired replicas=0 ещё не означает остановку старого consumer-контейнера.
|
||||
Helper и `make worker-stop` теперь ожидают фактическое отсутствие работающих контейнеров.
|
||||
Поздние независимые cases повторены через `--tail-only` с новыми пользователями и изображениями.
|
||||
Повтор завершился exit0; прежние успешные cases и время продолжения сохранены в JSON.
|
||||
Исходный полный вызов завершился exit1 и не объявляется успешным полным прогоном.
|
||||
Журналы: `evidence/lab5-faults-main.txt`, `evidence/lab5-faults-tail.txt`.
|
||||
Все case-level результаты находятся в `evidence/lab5-faults.json`.
|
||||
|
||||
Отдельный initial fault обнаружил старый worker при обновлении образа с прежним tag.
|
||||
`make up` теперь принудительно обновляет worker вместе с API.
|
||||
После исправления фактические JPEG/PNG EXIF проверки прошли.
|
||||
Статические проверки и команды воспроизведения собраны в `evidence/lab5-validation.txt`.
|
||||
`make test-persistence` прошёл после перезапуска компонентов собственного стенда.
|
||||
Подтверждённые данные и существующая сессия сохранились: `evidence/lab5-persistence.txt`.
|
||||
`make test-failover` прошёл при остановке одной из двух API-реплик.
|
||||
Зафиксированы 123 успешные записи, одна неудачная попытка и восстановление за 0,696s.
|
||||
Подтверждённые данные и сессия сохранились: `evidence/lab5-failover.txt`.
|
||||
|
||||
## Соответствие критериям
|
||||
|
||||
| Уровень | Критерий | Реализация и доказательство |
|
||||
| --- | --- | --- |
|
||||
| 3 | Возможности lab4 и переход upload на 202 | `PORTING.md`, публичный smoke, persistence/failover |
|
||||
| 3 | Устойчивый приём до ответа | MinIO staging + PostgreSQL attachment/job/outbox; cases `stage_before_commit`, `commit_publish_and_restarts` |
|
||||
| 3 | Отдельный broker/worker, durable at-least-once | Redis Streams/AOF; два broker restart, worker stop/start |
|
||||
| 3 | Четыре состояния, оригинал и thumbnail | Контракт API; smoke, `small_alpha_exif`, `bounded_retry_replay` |
|
||||
| 3 | Ограниченные повторы и единый результат | `max_attempts`, versioned keys; cases `crash_after_objects`, `commit_before_ack_and_duplicate` |
|
||||
| 4 | Crop/WebP, качество и ограничения | Renderer, pixel budget, process deadline; EXIF/alpha/geometry tests и `renderer_process_group_timeout` |
|
||||
| 4 | Восстановление разрыва COMMIT/publish | Transactional outbox; case `commit_publish_and_restarts` |
|
||||
| 4 | Backoff/jitter, permanent failure, failed registry/replay | Cases `bounded_retry_replay`, `permanent_stage_error`; audit replay |
|
||||
| 4 | Crash после S3, lease/fence, bounded concurrency/prefetch | Crash cases, `TestFenceIntegration`, конфигурация worker |
|
||||
| 4 | Безопасная очистка staging | Case `staging_cleanup`; ready/failed/unconfirmed retention |
|
||||
| 5 | Трек 1: настройки, размеры, backpressure и восстановление | Методика, raw данные, графики и ограничения в `RESEARCH.md` |
|
||||
|
||||
Источники case-level результатов: `evidence/lab5-faults.json` и журналы split-run выше.
|
||||
|
||||
+185
@@ -0,0 +1,185 @@
|
||||
# Исследование: очередь под перегрузкой
|
||||
|
||||
Выбран трек 1 лабораторной 5. Исследование сравнивает скорость, задержку и память при разных настройках обработки.
|
||||
Отдельный сценарий проверяет ограничение очереди и восстановление после перегрузки.
|
||||
|
||||
## Гипотеза
|
||||
|
||||
Рост числа параллельных обработок уменьшает ожидание, пока хватает процессора.
|
||||
После насыщения процессора дополнительные обработки увеличивают память и конкурируют за вычисления.
|
||||
Ограничение очереди сохраняет конечное число принятых заданий, когда worker остановлен.
|
||||
|
||||
## Что означают настройки
|
||||
|
||||
- `WORKER_CONCURRENCY` ограничивает число параллельных обработок внутри одного worker.
|
||||
- `WORKER_PREFETCH` ограничивает буфер заданий перед обработкой.
|
||||
- `WORKER_PIXEL_BUDGET` ограничивает суммарное число пикселей у активных обработок.
|
||||
- `MAX_OUTSTANDING_JOBS` ограничивает число заданий со статусом `queued` или `processing` в PostgreSQL.
|
||||
|
||||
Redis Streams хранит сообщения до подтверждения. PostgreSQL хранит состояние задания и намерение публикации.
|
||||
Сообщение Redis содержит идентификаторы. Байты изображения остаются в S3.
|
||||
Полная очередь приводит к HTTP `429`. Текстовые сообщения продолжают работать.
|
||||
|
||||
## Методика
|
||||
|
||||
Стенд включает один worker, две API-реплики, PostgreSQL, Redis и MinIO.
|
||||
Ограничения CPU и памяти worker сохраняются между запусками.
|
||||
Исходные изображения — PNG с псевдослучайными RGB-пикселями. Генератор использует фиксированное начальное значение.
|
||||
SHA-256 каждого изображения записывается в результат.
|
||||
|
||||
Скрипт сравнивает шесть запусков:
|
||||
|
||||
| Размер PNG | Concurrency | Prefetch | Число изображений |
|
||||
| --- | ---: | ---: | ---: |
|
||||
| 512×512 | 1 | 1 | 20 |
|
||||
| 512×512 | 2 | 4 | 20 |
|
||||
| 512×512 | 4 | 8 | 20 |
|
||||
| 1536×1536 | 1 | 1 | 20 |
|
||||
| 1536×1536 | 2 | 4 | 20 |
|
||||
| 1536×1536 | 4 | 8 | 20 |
|
||||
|
||||
Перед каждым запуском worker завершает все задания. Одно изображение прогревает pipeline после изменения настройки.
|
||||
Измерение начинается после прогрева. Восемь HTTP-потоков отправляют двадцать изображений.
|
||||
Скрипт опрашивает метаданные до `ready` для всех принятых вложений.
|
||||
После измерения скрипт проверяет оригинал и контрольные суммы трёх вариантов у одного вложения.
|
||||
|
||||
## Метрики
|
||||
|
||||
| Метрика | Определение |
|
||||
| --- | --- |
|
||||
| Throughput | Число готовых изображений / время всего пакета, включая upload и опрос |
|
||||
| p95 до ready | 95-й процентиль времени от начала POST до первого ответа `ready` |
|
||||
| p95 после 202 | 95-й процентиль времени от ответа `202` до первого ответа `ready` |
|
||||
| Queue lag | Возраст старейшего задания `queued` из текущего чата; `processing` исключается |
|
||||
| RSS | Сумма `VmRSS` worker, процессов обработки и `cwebp` |
|
||||
| Размер очереди | Число заданий `queued` и `processing` в PostgreSQL |
|
||||
|
||||
Процентиль рассчитывается методом ближайшего ранга. Для двадцати изображений p95 соответствует девятнадцатому значению после сортировки.
|
||||
Скрипт снимает RSS и queue lag между опросами API. Пауза между циклами составляет минимум 250 мс.
|
||||
Фактические интервалы содержатся в JSON. Команды Docker и запросы API увеличивают этот интервал.
|
||||
|
||||
## Результаты измерений
|
||||
|
||||
Дата измерений: 10 ноября 2026 года. Архитектура — arm64, Docker Engine — 29.5.2.
|
||||
Docker VM располагает двумя CPU и 1,91 GiB RAM.
|
||||
Worker ограничен одним CPU и 1536 MiB памяти. Эти ограничения одинаковы во всех шести запусках.
|
||||
Размеры входных файлов составили 787252 и 7081647 байт.
|
||||
Все 120 измеряемых загрузок вернули `202` и завершились статусом `ready`.
|
||||
|
||||
| PNG | Concurrency / prefetch | Throughput, изобр./с | p95 до ready, с | Queue lag max, с | RSS max, МиБ |
|
||||
| --- | ---: | ---: | ---: | ---: | ---: |
|
||||
| 512×512 | 1/1 | 3.316 | 4.76 | 4.08 | 32.2 |
|
||||
| 512×512 | 2/4 | 4.013 | 4.33 | 3.17 | 54.2 |
|
||||
| 512×512 | 4/8 | 3.903 | 4.45 | 2.67 | 90.3 |
|
||||
| 1536×1536 | 1/1 | 0.774 | 22.79 | 21.48 | 74.2 |
|
||||
| 1536×1536 | 2/4 | 0.851 | 21.47 | 18.20 | 134.3 |
|
||||
| 1536×1536 | 4/8 | 0.847 | 20.74 | 16.60 | 224.2 |
|
||||
|
||||

|
||||
|
||||
PNG-версия графика: [lab5-research.png](evidence/lab5-research.png).
|
||||
Точные значения, дополнительные метрики и исходные наблюдения доступны в JSON и CSV.
|
||||
|
||||
Для этого стенда рекомендована пара **concurrency=2, prefetch=4**. Она совпадает с настройкой по умолчанию.
|
||||
Она дала максимальный измеренный throughput для обоих размеров.
|
||||
Относительно 1/1 throughput вырос примерно на 21% для маленьких изображений и на 10% для крупных.
|
||||
Пиковый RSS при этом вырос с 32,2 до 54,2 МиБ и с 74,2 до 134,3 МиБ.
|
||||
|
||||
Переход от 2/4 к 4/8 не увеличил throughput.
|
||||
Для крупных изображений p95 улучшился примерно на 3,4%, а RSS вырос примерно на 67%.
|
||||
Для маленьких изображений выросли и RSS, и p95.
|
||||
Выбор 1/1 уменьшает расход памяти ценой большей задержки и меньшей скорости.
|
||||
|
||||
Результат согласуется с гипотезой об ограниченной пользе параллелизма при одном CPU.
|
||||
Он не доказывает причину насыщения: upload, S3 и PostgreSQL также входят в измерение.
|
||||
Меньший queue lag при 4/8 не означает пропорционального ускорения pipeline.
|
||||
Метрика исключает задания `processing`, число которых может расти вместе с concurrency.
|
||||
Разницу в несколько процентов следует проверить повторными сериями перед изменением рабочих настроек.
|
||||
|
||||
## Перегрузка и восстановление
|
||||
|
||||
Скрипт останавливает worker и устанавливает лимит восемь заданий на обеих API-репликах.
|
||||
Затем шестнадцать запросов конкурируют за этот общий лимит.
|
||||
Проверка требует восемь ответов `202`, восемь ответов `429` и восемь заданий в PostgreSQL.
|
||||
Заголовки `X-Instance-Id` подтверждают участие обеих API-реплик.
|
||||
|
||||
После запуска worker все восемь принятых заданий завершаются.
|
||||
Скрипт проверяет пустую очередь и новый успешный upload.
|
||||
Скрипт восстанавливает исходные настройки после эксперимента, в том числе при ошибке проверки.
|
||||
|
||||
Фактический результат:
|
||||
|
||||
| Проверка | Результат |
|
||||
| --- | --- |
|
||||
| Остановленный worker, лимит 8, предложено 16 | 8 ответов `202`, 8 ответов `429` |
|
||||
| Участие API | Подтверждены две разные реплики |
|
||||
| Незавершённые задания при остановленном worker | Ровно 8 |
|
||||
| Текстовое сообщение при полной очереди | Сохранено успешно |
|
||||
| Принятые задания после запуска worker | Все 8 стали `ready` |
|
||||
| Незавершённые задания после восстановления | 0 |
|
||||
| Следующая загрузка после освобождения очереди | `202`, затем `ready` |
|
||||
|
||||
Счётчик завершения проверяется после ожидания готовности worker.
|
||||
Часть обработки проходит во время этого ожидания, поэтому отдельное поле drain не измеряет полное время восстановления.
|
||||
Опыт подтверждает общий лимит между репликами и сохранность принятой работы после `202`.
|
||||
Эксперимент завершился с `PASS`. Исходные настройки worker и API восстановлены и проверены отдельно.
|
||||
|
||||
## Повторение
|
||||
|
||||
Запустите стенд:
|
||||
|
||||
```sh
|
||||
make up
|
||||
make test
|
||||
```
|
||||
|
||||
Остановите другие нагрузочные проверки. Запустите исследование:
|
||||
|
||||
```sh
|
||||
make benchmark
|
||||
```
|
||||
|
||||
Установите зависимости для графика:
|
||||
|
||||
```sh
|
||||
.venv/bin/python -m pip install -r requirements-research.txt
|
||||
```
|
||||
|
||||
Создайте график:
|
||||
|
||||
```sh
|
||||
make plot-research
|
||||
```
|
||||
|
||||
Скрипт сохраняет исходные наблюдения в `evidence/lab5-research.json`.
|
||||
Таблица находится в `evidence/lab5-research.csv`. Графики сохраняются в SVG и PNG рядом с таблицей.
|
||||
JSON содержит версию Docker, число CPU, память, образ worker и ограничения контейнера.
|
||||
|
||||
## Ограничения
|
||||
|
||||
Измерения относятся к одному локальному стенду. Пакет из двадцати изображений не определяет производственный SLA.
|
||||
В каждом запуске есть прогрев, но независимых повторений для доверительного интервала нет.
|
||||
Concurrency и prefetch меняются вместе. Результат сравнивает пары настроек и не изолирует влияние каждого параметра.
|
||||
|
||||
HTTP upload, проверка изображения, S3 и PostgreSQL также влияют на throughput.
|
||||
Глобальная блокировка при приёме задания сериализует участок записи staging и регистрации задания.
|
||||
Увеличение concurrency не устраняет это ограничение API.
|
||||
Admission ограничивает незавершённую работу. Concurrency и бюджет пикселей ограничивают память обработки.
|
||||
Этот лимит не ограничивает общий размер готовых вложений на диске.
|
||||
|
||||
Опрос добавляет задержку к наблюдаемому времени до `ready`.
|
||||
Выборка RSS может пропустить короткий пик. Общие страницы памяти могут учитываться несколько раз.
|
||||
Небольшая часть RSS относится к самой команде наблюдения внутри контейнера.
|
||||
Значение RSS не равно использованию памяти cgroup с файловым кешем.
|
||||
|
||||
## Объяснение для защиты
|
||||
|
||||
1. API возвращает `202` после сохранения файла и задания. Обработка изображения продолжается отдельно.
|
||||
2. Redis хранит очередь доставки. PostgreSQL хранит состояние и восстанавливает публикацию через outbox.
|
||||
3. Concurrency задаёт число одновременных обработок. Prefetch задаёт запас заданий перед обработкой.
|
||||
4. Задержка растёт, когда задания поступают быстрее обработки. Бесконечная очередь увеличивает ожидание и расход ресурсов.
|
||||
5. Лимит очереди возвращает `429` для новой работы. Работа после уже выданного `202` сохраняется.
|
||||
6. После запуска worker очередь завершается. Повторный upload проходит без изменения принятого ранее задания.
|
||||
7. Подтверждение Redis происходит после устойчивого результата. Повтор доставки безопасен благодаря состоянию задания и ключам вариантов.
|
||||
|
||||
Это доставка at least once. Повтор доставки возможен, поэтому результат защищён от повторного применения.
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
"github.com/redis/go-redis/v9"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/app/chat"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/attachment"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/config"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/repository/postgres"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/session"
|
||||
chatusecase "gitflic.ru/akselbant/mtusi2026lab1-fork/internal/usecase/chat"
|
||||
)
|
||||
|
||||
const shutdownTimeout = 8 * time.Second
|
||||
|
||||
func main() {
|
||||
cfg, err := config.Load()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
poolConfig, err := pgxpool.ParseConfig("sslmode=disable")
|
||||
if err != nil {
|
||||
log.Fatal("invalid PostgreSQL config")
|
||||
}
|
||||
poolConfig.ConnConfig.Host = cfg.PostgresHost
|
||||
poolConfig.ConnConfig.Port = cfg.PostgresPort
|
||||
poolConfig.ConnConfig.User = cfg.PostgresUser
|
||||
poolConfig.ConnConfig.Database = cfg.PostgresDatabase
|
||||
poolConfig.ConnConfig.Password = cfg.PostgresPassword
|
||||
poolConfig.ConnConfig.ConnectTimeout = cfg.QueryTimeout
|
||||
poolConfig.ConnConfig.RuntimeParams["timezone"] = "UTC"
|
||||
poolConfig.ConnConfig.RuntimeParams["statement_timeout"] = fmt.Sprint(cfg.QueryTimeout.Milliseconds())
|
||||
poolConfig.MaxConns = cfg.PostgresMaxConns
|
||||
poolConfig.MinConns = 1
|
||||
poolConfig.MaxConnLifetime = time.Hour
|
||||
poolConfig.MaxConnIdleTime = 5 * time.Minute
|
||||
pool, err := pgxpool.NewWithConfig(context.Background(), poolConfig)
|
||||
if err != nil {
|
||||
log.Fatal("cannot create PostgreSQL pool")
|
||||
}
|
||||
defer pool.Close()
|
||||
redisClient := redis.NewClient(&redis.Options{
|
||||
Addr: cfg.RedisAddr, PoolSize: 10, MaxActiveConns: 10, PoolTimeout: cfg.QueryTimeout,
|
||||
DialTimeout: cfg.QueryTimeout, ReadTimeout: cfg.QueryTimeout, WriteTimeout: cfg.QueryTimeout,
|
||||
MaxRetries: -1, ContextTimeoutEnabled: true,
|
||||
})
|
||||
defer redisClient.Close()
|
||||
repo := postgres.New(pool, cfg.QueryTimeout)
|
||||
sessions := session.NewRedis(redisClient, cfg.QueryTimeout)
|
||||
useCase := chatusecase.New(repo, sessions, cfg.SessionTTL)
|
||||
objectStore, err := attachment.NewStore(cfg.S3Endpoint, cfg.S3Bucket, cfg.S3AccessKey, cfg.S3SecretKey, cfg.S3UseSSL)
|
||||
if err != nil {
|
||||
log.Fatal("invalid S3 config")
|
||||
}
|
||||
options, err := attachment.LoadOptions()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
attachments := attachment.NewAsync(pool, objectStore, options)
|
||||
background, stopPublisher := context.WithCancel(context.Background())
|
||||
defer stopPublisher()
|
||||
go attachments.RunPublisher(background, redisClient)
|
||||
handler := chat.NewChat(useCase, cfg.CursorKey).WithAttachments(attachments)
|
||||
port := cfg.Port
|
||||
e := handler.Router()
|
||||
e.Server.ReadHeaderTimeout = 5 * time.Second
|
||||
e.Server.ReadTimeout = 50 * time.Second
|
||||
e.Server.WriteTimeout = 55 * time.Second
|
||||
e.Server.IdleTimeout = 60 * time.Second
|
||||
|
||||
serverErrors := make(chan error, 1)
|
||||
go func() {
|
||||
log.Printf("HTTP server is listening on :%s", port)
|
||||
serverErrors <- e.Start(":" + port)
|
||||
}()
|
||||
|
||||
stop := make(chan os.Signal, 1)
|
||||
signal.Notify(stop, syscall.SIGINT, syscall.SIGTERM)
|
||||
select {
|
||||
case sig := <-stop:
|
||||
log.Printf("received %s, shutting down", sig)
|
||||
case err := <-serverErrors:
|
||||
if !errors.Is(err, http.ErrServerClosed) {
|
||||
log.Fatalf("HTTP server failed: %v", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
handler.Drain()
|
||||
// Allow two 1-second LB checks to remove this backend before closing the listener.
|
||||
time.Sleep(3 * time.Second)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), shutdownTimeout)
|
||||
defer cancel()
|
||||
if err := e.Shutdown(ctx); err != nil {
|
||||
log.Printf("graceful shutdown failed: %v", err)
|
||||
if closeErr := e.Close(); closeErr != nil {
|
||||
log.Printf("forced shutdown failed: %v", closeErr)
|
||||
}
|
||||
return
|
||||
}
|
||||
log.Printf("shutdown complete")
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/attachment"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/config"
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
)
|
||||
|
||||
func main() {
|
||||
apply := flag.Bool("apply", false, "apply safe repairs; default dry-run")
|
||||
grace := flag.Duration("grace", 2*time.Minute, "minimum object/metadata age (at least 90s)")
|
||||
timeout := flag.Duration("timeout", 10*time.Minute, "whole scan deadline")
|
||||
flag.Parse()
|
||||
if *grace < attachment.MinimumGrace {
|
||||
log.Fatal("grace must be at least 90s")
|
||||
}
|
||||
cfg, err := config.Load()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
pc, err := pgxpool.ParseConfig("sslmode=disable")
|
||||
if err != nil {
|
||||
log.Fatal("invalid DB config")
|
||||
}
|
||||
pc.ConnConfig.Host = cfg.PostgresHost
|
||||
pc.ConnConfig.Port = cfg.PostgresPort
|
||||
pc.ConnConfig.User = cfg.PostgresUser
|
||||
pc.ConnConfig.Password = cfg.PostgresPassword
|
||||
pc.ConnConfig.Database = cfg.PostgresDatabase
|
||||
pc.ConnConfig.ConnectTimeout = 3 * time.Second
|
||||
pc.ConnConfig.RuntimeParams["statement_timeout"] = "5000"
|
||||
pc.MaxConns = 2
|
||||
ctx, cancel := context.WithTimeout(context.Background(), *timeout)
|
||||
defer cancel()
|
||||
pool, err := pgxpool.NewWithConfig(ctx, pc)
|
||||
if err != nil {
|
||||
log.Fatal("cannot create DB pool")
|
||||
}
|
||||
defer pool.Close()
|
||||
store, err := attachment.NewStore(cfg.S3Endpoint, cfg.S3Bucket, cfg.S3AccessKey, cfg.S3SecretKey, cfg.S3UseSSL)
|
||||
if err != nil {
|
||||
log.Fatal("invalid S3 config")
|
||||
}
|
||||
result, err := attachment.New(pool, store).Reconcile(ctx, *apply, *grace)
|
||||
_ = json.NewEncoder(os.Stdout).Encode(result)
|
||||
if err != nil {
|
||||
log.Print(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"flag"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/attachment"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/config"
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if len(os.Args) > 1 && os.Args[1] == "render" {
|
||||
if len(os.Args) != 5 {
|
||||
os.Exit(2)
|
||||
}
|
||||
if err := attachment.Render(context.Background(), os.Args[2], os.Args[3], os.Args[4]); err != nil {
|
||||
if errors.Is(err, attachment.ErrInvalidImage) {
|
||||
os.Exit(2)
|
||||
}
|
||||
os.Exit(1)
|
||||
}
|
||||
return
|
||||
}
|
||||
failed := flag.Bool("failed", false, "list failed job registry")
|
||||
replay := flag.String("replay", "", "failed job UUID to replay")
|
||||
operator := flag.String("operator", "", "operator identity")
|
||||
reason := flag.String("reason", "", "replay reason")
|
||||
flag.Parse()
|
||||
cfg, err := config.Load()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
options, err := attachment.LoadOptions()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
pc, err := pgxpool.ParseConfig("sslmode=disable")
|
||||
if err != nil {
|
||||
log.Fatal("invalid DB config")
|
||||
}
|
||||
pc.ConnConfig.Host = cfg.PostgresHost
|
||||
pc.ConnConfig.Port = cfg.PostgresPort
|
||||
pc.ConnConfig.User = cfg.PostgresUser
|
||||
pc.ConnConfig.Password = cfg.PostgresPassword
|
||||
pc.ConnConfig.Database = cfg.PostgresDatabase
|
||||
pc.ConnConfig.ConnectTimeout = 3 * time.Second
|
||||
pc.ConnConfig.RuntimeParams["timezone"] = "UTC"
|
||||
pc.ConnConfig.RuntimeParams["statement_timeout"] = "5000"
|
||||
pc.MaxConns = int32(options.Concurrency + 4)
|
||||
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
|
||||
defer cancel()
|
||||
pool, err := pgxpool.NewWithConfig(ctx, pc)
|
||||
if err != nil {
|
||||
log.Fatal("DB configuration failed")
|
||||
}
|
||||
defer pool.Close()
|
||||
store, err := attachment.NewStore(cfg.S3Endpoint, cfg.S3Bucket, cfg.S3AccessKey, cfg.S3SecretKey, cfg.S3UseSSL)
|
||||
if err != nil {
|
||||
log.Fatal("S3 configuration failed")
|
||||
}
|
||||
service := attachment.NewAsync(pool, store, options)
|
||||
if *failed {
|
||||
rows, e := pool.Query(ctx, `SELECT id::text,attachment_id::text,attempts,max_attempts,coalesce(last_error,''),updated_at FROM attachment_jobs WHERE state='failed' ORDER BY updated_at DESC LIMIT 100`)
|
||||
if e != nil {
|
||||
log.Fatal("cannot query failed jobs")
|
||||
}
|
||||
defer rows.Close()
|
||||
records := []map[string]interface{}{}
|
||||
for rows.Next() {
|
||||
var id, att, code string
|
||||
var attempt, max int
|
||||
var updated time.Time
|
||||
if e = rows.Scan(&id, &att, &attempt, &max, &code, &updated); e != nil {
|
||||
log.Fatal("invalid failed job")
|
||||
}
|
||||
records = append(records, map[string]interface{}{"job_id": id, "attachment_id": att, "attempts": attempt, "max_attempts": max, "error_code": code, "updated_at": updated.UTC()})
|
||||
}
|
||||
if rows.Err() != nil {
|
||||
log.Fatal("failed jobs query interrupted")
|
||||
}
|
||||
json.NewEncoder(os.Stdout).Encode(records)
|
||||
return
|
||||
}
|
||||
if *replay != "" {
|
||||
operation, stop := context.WithTimeout(ctx, 10*time.Second)
|
||||
defer stop()
|
||||
if err = service.Replay(operation, *replay, *operator, *reason); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
log.Print("Replay committed with audit record")
|
||||
return
|
||||
}
|
||||
r := redis.NewClient(&redis.Options{Addr: cfg.RedisAddr, DialTimeout: 2 * time.Second, ReadTimeout: 2 * time.Second, WriteTimeout: 2 * time.Second, MaxRetries: -1, ContextTimeoutEnabled: true})
|
||||
defer r.Close()
|
||||
log.Printf("Worker started: concurrency=%d prefetch=%d timeout=%s lease=%s pixel_budget=%d", options.Concurrency, options.Prefetch, options.Timeout, options.Lease, options.PixelBudget)
|
||||
for ctx.Err() == nil {
|
||||
err = service.RunWorker(ctx, r)
|
||||
if err != nil {
|
||||
log.Print("worker broker connection will retry")
|
||||
}
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-time.After(time.Second):
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
# Topology worksheet, deliberately NOT a runnable stack (no application supplied).
|
||||
# Implement compose.yaml or stack.yaml; do not submit this empty file as deployment.
|
||||
# Service names below are logical roles, not imposed container names.
|
||||
x-lab-number: 5
|
||||
x-lab-number: 4
|
||||
x-required-roles:
|
||||
- api
|
||||
- postgres
|
||||
- load_balancer
|
||||
- s3
|
||||
- broker
|
||||
- worker
|
||||
# TODO: implement real images/builds, network wiring, volumes, healthchecks,
|
||||
# credentials and bootstrap. Details: contracts/infrastructure.json and README.md.
|
||||
services: {}
|
||||
|
||||
+182
@@ -0,0 +1,182 @@
|
||||
name: mtusi2026lab5
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17.6-alpine3.22
|
||||
environment:
|
||||
POSTGRES_USER: messenger
|
||||
POSTGRES_DB: messenger
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
||||
secrets:
|
||||
- postgres_password
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: [CMD-SHELL, 'pg_isready -U messenger -d messenger']
|
||||
interval: 2s
|
||||
timeout: 2s
|
||||
retries: 30
|
||||
cpus: 1.0
|
||||
mem_limit: 512m
|
||||
redis:
|
||||
image: redis:7.4.5-alpine3.21
|
||||
command: [redis-server, /usr/local/etc/redis/redis.conf]
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
- ./infra/redis.conf:/usr/local/etc/redis/redis.conf:ro
|
||||
healthcheck:
|
||||
test: [CMD, redis-cli, ping]
|
||||
interval: 2s
|
||||
timeout: 2s
|
||||
retries: 30
|
||||
cpus: 0.5
|
||||
mem_limit: 384m
|
||||
minio:
|
||||
image: mtusi-minio:RELEASE.2025-09-07T16-13-09Z
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.storage
|
||||
target: minio
|
||||
secrets: [s3_root_access_key, s3_root_secret_key]
|
||||
volumes: [s3_data:/data]
|
||||
healthcheck:
|
||||
test: [CMD, wget, -q, -T, '2', -O, /dev/null, 'http://127.0.0.1:9000/minio/health/live']
|
||||
interval: 2s
|
||||
timeout: 3s
|
||||
start_period: 15s
|
||||
retries: 30
|
||||
cpus: 1.0
|
||||
mem_limit: 512m
|
||||
stop_grace_period: 20s
|
||||
s3_bootstrap:
|
||||
image: mtusi-mc:RELEASE.2025-08-13T08-35-41Z
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.storage
|
||||
target: mc
|
||||
entrypoint: [/bin/sh, /bootstrap.sh]
|
||||
configs:
|
||||
- source: s3_bootstrap
|
||||
target: /bootstrap.sh
|
||||
- source: s3_policy
|
||||
target: /policy.json
|
||||
secrets: [s3_root_access_key, s3_root_secret_key, s3_access_key, s3_secret_key]
|
||||
depends_on:
|
||||
minio:
|
||||
condition: service_healthy
|
||||
cpus: 0.5
|
||||
mem_limit: 512m
|
||||
migrations:
|
||||
image: mtusi-migrations:lab5
|
||||
build:
|
||||
context: .
|
||||
target: migrations
|
||||
environment:
|
||||
GOOSE_DRIVER: postgres
|
||||
GOOSE_DBSTRING: host=postgres user=messenger dbname=messenger sslmode=disable connect_timeout=5
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
||||
secrets:
|
||||
- postgres_password
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
cpus: 0.5
|
||||
mem_limit: 128m
|
||||
api:
|
||||
build: .
|
||||
image: mtusi-messenger:lab5
|
||||
environment: &api_environment
|
||||
POSTGRES_HOST: postgres
|
||||
POSTGRES_USER: messenger
|
||||
POSTGRES_DB: messenger
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
||||
POSTGRES_MAX_CONNS: '10'
|
||||
REDIS_ADDR: redis:6379
|
||||
CURSOR_KEY_FILE: /run/secrets/cursor_key
|
||||
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
||||
QUERY_TIMEOUT_MS: '2000'
|
||||
S3_ENDPOINT: minio:9000
|
||||
S3_BUCKET: attachments
|
||||
S3_ACCESS_KEY_FILE: /run/secrets/s3_access_key
|
||||
S3_SECRET_KEY_FILE: /run/secrets/s3_secret_key
|
||||
S3_USE_SSL: 'false'
|
||||
GOMEMLIMIT: 1152MiB
|
||||
GOGC: '50'
|
||||
secrets: &api_secrets
|
||||
- postgres_password
|
||||
- cursor_key
|
||||
- s3_access_key
|
||||
- s3_secret_key
|
||||
ports:
|
||||
- '127.0.0.1:${PORT:-18085}:8080'
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
migrations:
|
||||
condition: service_completed_successfully
|
||||
s3_bootstrap:
|
||||
condition: service_completed_successfully
|
||||
cpus: 1.0
|
||||
mem_limit: 1536m
|
||||
stop_grace_period: 10s
|
||||
worker:
|
||||
image: mtusi-messenger:lab5
|
||||
build: .
|
||||
entrypoint: [/usr/local/bin/worker]
|
||||
environment:
|
||||
<<: *api_environment
|
||||
WORKER_CONCURRENCY: '2'
|
||||
WORKER_PREFETCH: '4'
|
||||
WORKER_MAX_ATTEMPTS: '5'
|
||||
WORKER_TIMEOUT_SECONDS: '25'
|
||||
WORKER_LEASE_SECONDS: '40'
|
||||
WORKER_PIXEL_BUDGET: '40000000'
|
||||
secrets: *api_secrets
|
||||
healthcheck: {disable: true}
|
||||
depends_on:
|
||||
migrations: {condition: service_completed_successfully}
|
||||
s3_bootstrap: {condition: service_completed_successfully}
|
||||
redis: {condition: service_healthy}
|
||||
cpus: 1.0
|
||||
mem_limit: 1536m
|
||||
stop_grace_period: 10s
|
||||
tests:
|
||||
image: mtusi-messenger-tests:lab5
|
||||
profiles: [test]
|
||||
build:
|
||||
context: .
|
||||
target: tests
|
||||
environment:
|
||||
<<: *api_environment
|
||||
INTEGRATION_TESTS: '1'
|
||||
secrets: *api_secrets
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
cpus: 1.0
|
||||
mem_limit: 1g
|
||||
configs:
|
||||
s3_bootstrap:
|
||||
file: ./infra/s3-bootstrap.sh
|
||||
s3_policy:
|
||||
file: ./infra/s3-policy.json
|
||||
secrets:
|
||||
s3_root_access_key:
|
||||
file: ./secrets/s3_root_access_key
|
||||
s3_root_secret_key:
|
||||
file: ./secrets/s3_root_secret_key
|
||||
s3_access_key:
|
||||
file: ./secrets/s3_access_key
|
||||
s3_secret_key:
|
||||
file: ./secrets/s3_secret_key
|
||||
postgres_password:
|
||||
file: ./secrets/postgres_password
|
||||
cursor_key:
|
||||
file: ./secrets/cursor_key
|
||||
volumes:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
s3_data:
|
||||
@@ -0,0 +1,9 @@
|
||||
package contracts
|
||||
|
||||
import _ "embed"
|
||||
|
||||
// OpenAPI is embedded so Swagger UI works from a compiled binary and does not
|
||||
// depend on the process working directory.
|
||||
//
|
||||
//go:embed openapi.json
|
||||
var OpenAPI []byte
|
||||
@@ -0,0 +1,13 @@
|
||||
package dto
|
||||
|
||||
type CreateChatRequest struct {
|
||||
Title string `json:"title"`
|
||||
MemberIDs []string `json:"member_ids"`
|
||||
}
|
||||
|
||||
type CreateChatResponse struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
MemberIDs []string `json:"member_ids"`
|
||||
CreatedAt Timestamp `json:"created_at"`
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package dto
|
||||
|
||||
type CreateMessageRequest struct {
|
||||
ChatID string `json:"-"`
|
||||
Text string `json:"text"`
|
||||
AttachmentIDs []string `json:"attachment_ids"`
|
||||
}
|
||||
|
||||
type CreateMessageResponse struct {
|
||||
ID string `json:"id"`
|
||||
ChatID string `json:"chat_id"`
|
||||
SenderID string `json:"sender_id"`
|
||||
Text string `json:"text"`
|
||||
AttachmentIDs []string `json:"attachment_ids"`
|
||||
CreatedAt Timestamp `json:"created_at"`
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
)
|
||||
|
||||
// Keep absent attachment_ids equivalent to [], while rejecting JSON null and
|
||||
// wrong types rather than quietly treating them as an empty message body.
|
||||
func (r *CreateMessageRequest) UnmarshalJSON(data []byte) error {
|
||||
type payload CreateMessageRequest
|
||||
var fields map[string]json.RawMessage
|
||||
if err := json.Unmarshal(data, &fields); err != nil || fields == nil {
|
||||
return errors.New("Ожидается JSON-объект")
|
||||
}
|
||||
text, exists := fields["text"]
|
||||
if !exists || bytes.Equal(bytes.TrimSpace(text), []byte("null")) {
|
||||
return errors.New("Требуется строка text")
|
||||
}
|
||||
if ids, exists := fields["attachment_ids"]; exists && bytes.Equal(bytes.TrimSpace(ids), []byte("null")) {
|
||||
return errors.New("attachment_ids должен быть массивом")
|
||||
}
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
var decoded payload
|
||||
if err := decoder.Decode(&decoded); err != nil {
|
||||
return err
|
||||
}
|
||||
decoded.ChatID = r.ChatID
|
||||
*r = CreateMessageRequest(decoded)
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMessageStrictFields(t *testing.T) {
|
||||
for _, body := range []string{`null`, `[]`, `{}`, `{"text":null}`, `{"text":"x","attachment_ids":null}`, `{"text":"x","attachment_ids":"x"}`, `{"text":"x","extra":1}`} {
|
||||
var r CreateMessageRequest
|
||||
if err := json.Unmarshal([]byte(body), &r); err == nil {
|
||||
t.Fatalf("accepted %s", body)
|
||||
}
|
||||
}
|
||||
for _, body := range []string{`{"text":"x"}`, `{"text":"x","attachment_ids":[]}`, `{"text":"","attachment_ids":["id"]}`} {
|
||||
var r CreateMessageRequest
|
||||
if err := json.Unmarshal([]byte(body), &r); err != nil {
|
||||
t.Fatalf("rejected %s: %v", body, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package dto
|
||||
|
||||
type CreateUserRequest struct {
|
||||
Password string `json:"password"`
|
||||
Username string `json:"username"`
|
||||
DisplayName string `json:"display_name"`
|
||||
}
|
||||
|
||||
type CreateUserResponse struct {
|
||||
ID string `json:"id"`
|
||||
Username string `json:"username"`
|
||||
DisplayName string `json:"display_name"`
|
||||
CreatedAt Timestamp `json:"created_at"`
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package dto
|
||||
|
||||
type CurrentUserRequest struct{}
|
||||
|
||||
type CurrentUserResponse struct {
|
||||
ID string `json:"id"`
|
||||
Username string `json:"username"`
|
||||
DisplayName string `json:"display_name"`
|
||||
CreatedAt Timestamp `json:"created_at"`
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package dto
|
||||
|
||||
type ErrorResponse struct {
|
||||
Error ErrorDetails `json:"error"`
|
||||
}
|
||||
|
||||
type ErrorDetails struct {
|
||||
Code string `json:"code"`
|
||||
Message string `json:"message"`
|
||||
RequestID string `json:"request_id"`
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package dto
|
||||
|
||||
type GetChatRequest struct {
|
||||
ChatID string `json:"-"`
|
||||
}
|
||||
|
||||
type GetChatResponse struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
MemberIDs []string `json:"member_ids"`
|
||||
CreatedAt Timestamp `json:"created_at"`
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package dto
|
||||
|
||||
type ListChatsRequest struct {
|
||||
Limit int `json:"-"`
|
||||
Cursor string `json:"-"`
|
||||
}
|
||||
|
||||
type ListChatsResponse struct {
|
||||
Items []ListChatsItem `json:"items"`
|
||||
NextCursor *string `json:"next_cursor"`
|
||||
}
|
||||
|
||||
type ListChatsItem struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
MemberIDs []string `json:"member_ids"`
|
||||
CreatedAt Timestamp `json:"created_at"`
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package dto
|
||||
|
||||
type ListMessagesRequest struct {
|
||||
ChatID string `json:"-"`
|
||||
Limit int `json:"-"`
|
||||
Cursor string `json:"-"`
|
||||
}
|
||||
|
||||
type ListMessagesResponse struct {
|
||||
Items []ListMessagesItem `json:"items"`
|
||||
NextCursor *string `json:"next_cursor"`
|
||||
}
|
||||
|
||||
type ListMessagesItem struct {
|
||||
ID string `json:"id"`
|
||||
ChatID string `json:"chat_id"`
|
||||
SenderID string `json:"sender_id"`
|
||||
Text string `json:"text"`
|
||||
AttachmentIDs []string `json:"attachment_ids"`
|
||||
CreatedAt Timestamp `json:"created_at"`
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package dto
|
||||
|
||||
type LivenessRequest struct{}
|
||||
|
||||
type LivenessResponse struct {
|
||||
Status string `json:"status"`
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package dto
|
||||
|
||||
type ReadinessRequest struct{}
|
||||
|
||||
type ReadinessResponse struct {
|
||||
Status string `json:"status"`
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package dto
|
||||
|
||||
type CreateSessionResponse struct {
|
||||
Token string `json:"token"`
|
||||
TokenType string `json:"token_type"`
|
||||
ExpiresAt Timestamp `json:"expires_at"`
|
||||
User CreateUserResponse `json:"user"`
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package dto
|
||||
|
||||
import "time"
|
||||
|
||||
// Timestamp preserves PostgreSQL microseconds and is readable by Python 3.9 clients.
|
||||
// time.Time's variable-length fractional part is not supported by those clients.
|
||||
type Timestamp time.Time
|
||||
|
||||
func (t Timestamp) MarshalJSON() ([]byte, error) {
|
||||
return []byte(`"` + time.Time(t).UTC().Format("2006-01-02T15:04:05.000000Z") + `"`), nil
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestTimestampFixedMicroseconds(t *testing.T) {
|
||||
timestamp := Timestamp(time.Date(2026, 1, 2, 3, 4, 5, 123400000, time.UTC))
|
||||
encoded, err := json.Marshal(timestamp)
|
||||
if err != nil || string(encoded) != `"2026-01-02T03:04:05.123400Z"` {
|
||||
t.Fatalf("timestamp=%s err=%v", encoded, err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"negative_cases": [
|
||||
{
|
||||
"case": "oversized_bytes",
|
||||
"status": 413
|
||||
},
|
||||
{
|
||||
"case": "damaged_png",
|
||||
"status": 415
|
||||
},
|
||||
{
|
||||
"case": "corrupt_crc",
|
||||
"status": 415
|
||||
},
|
||||
{
|
||||
"case": "mime_spoof",
|
||||
"status": 415
|
||||
},
|
||||
{
|
||||
"case": "not_image",
|
||||
"status": 415
|
||||
},
|
||||
{
|
||||
"case": "unsupported_mime",
|
||||
"status": 415
|
||||
},
|
||||
{
|
||||
"case": "pixel_budget",
|
||||
"status": 413
|
||||
},
|
||||
{
|
||||
"case": "unsafe_slash",
|
||||
"status": 400
|
||||
},
|
||||
{
|
||||
"case": "unsafe_backslash",
|
||||
"status": 400
|
||||
},
|
||||
{
|
||||
"case": "unsafe_control",
|
||||
"status": 400
|
||||
},
|
||||
{
|
||||
"case": "empty_filename",
|
||||
"status": 400
|
||||
},
|
||||
{
|
||||
"case": "foreign_attachment",
|
||||
"status": 404
|
||||
},
|
||||
{
|
||||
"case": "foreign_chat_link",
|
||||
"status": 404
|
||||
},
|
||||
{
|
||||
"case": "unknown_attachment",
|
||||
"status": 404
|
||||
},
|
||||
{
|
||||
"case": "duplicate_ids",
|
||||
"status": 400
|
||||
},
|
||||
{
|
||||
"case": "missing_authentication",
|
||||
"status": 401
|
||||
},
|
||||
{
|
||||
"case": "unknown_variant",
|
||||
"status": 404
|
||||
},
|
||||
{
|
||||
"case": "chunked_oversized",
|
||||
"status": 413
|
||||
}
|
||||
],
|
||||
"failures": {
|
||||
"client_disconnect": {
|
||||
"metadata_added": 0,
|
||||
"spool_files_remaining": 0
|
||||
},
|
||||
"upload_replica_failure": {
|
||||
"upload_instance": "alixbvpbjnzvtqvo5hhfpokc6",
|
||||
"download_instance": "h6fc30dhoabp0jcfl6zrpjdzx",
|
||||
"recovery_seconds": 0.51,
|
||||
"sha256": "8502afe2cc5bab33ac834c834874369d29e7896599b5a256d68d80c5395d99c3"
|
||||
},
|
||||
"s3_outage": {
|
||||
"liveness": 200,
|
||||
"readiness": 503,
|
||||
"recovery_seconds": 19.285
|
||||
}
|
||||
},
|
||||
"checksums": {
|
||||
"image/png": "8502afe2cc5bab33ac834c834874369d29e7896599b5a256d68d80c5395d99c3",
|
||||
"image/jpeg": "41feb40d75a595386c72cfc8a5bc013c2dedc445b73316ebbd3b3eac13491c5d"
|
||||
},
|
||||
"bucket_security": {
|
||||
"anonymous_get_status": 403,
|
||||
"create_bucket_denied": true,
|
||||
"write_outside_prefix_denied": true,
|
||||
"console_published": false,
|
||||
"bootstrap_repeats": 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
.venv/bin/python tests/own/lab4.py
|
||||
PASS: PNG/JPEG, bounded uploads, MIME/damage/ACL/link errors, disconnect, private S3, repeat bootstrap, S3 outage.
|
||||
@@ -0,0 +1,8 @@
|
||||
image mtusi-mc:RELEASE.2025-08-13T08-35-41Z could not be accessed on a registry to record
|
||||
its digest. Each node will access mtusi-mc:RELEASE.2025-08-13T08-35-41Z independently,
|
||||
possibly leading to different nodes running different
|
||||
versions of the image.
|
||||
|
||||
0pza81k652zzumhh8w5zfuxw8
|
||||
mtusi-lab4_s3-bootstrap.0.jjp4j3jx92l1@colima | PASS: private bucket and restricted API account configured.
|
||||
mtusi-lab4_s3-bootstrap
|
||||
@@ -0,0 +1,112 @@
|
||||
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
|
||||
Install the buildx component to build images with BuildKit:
|
||||
https://docs.docker.com/go/buildx/
|
||||
|
||||
Sending build context to Docker daemon 401.9kB␍
|
||||
Step 1/35 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS goose-builder
|
||||
---> 18b460dd1754
|
||||
Step 2/35 : RUN GOBIN=/out CGO_ENABLED=0 go install -tags='no_clickhouse no_libsql no_mssql no_mysql no_sqlite3 no_vertica no_ydb no_spanner' github.com/pressly/goose/v3/cmd/goose@v3.27.1
|
||||
---> Using cache
|
||||
---> 7012ef857c0c
|
||||
Step 3/35 : FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616 AS migrations
|
||||
---> 075c2c1a4068
|
||||
Step 4/35 : COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
---> Using cache
|
||||
---> 6a0ad52336c1
|
||||
Step 5/35 : COPY migrations /migrations
|
||||
---> Using cache
|
||||
---> 19018c7bfac9
|
||||
Step 6/35 : COPY infra/migrate.sh /usr/local/bin/migrate
|
||||
---> Using cache
|
||||
---> 0cc075ba3459
|
||||
Step 7/35 : USER 10001:10001
|
||||
---> Using cache
|
||||
---> 37de51af32cd
|
||||
Step 8/35 : ENTRYPOINT ["/usr/local/bin/migrate"]
|
||||
---> Using cache
|
||||
---> e7539a967679
|
||||
Step 9/35 : CMD ["up"]
|
||||
---> Using cache
|
||||
---> 841d9bb239cd
|
||||
Step 10/35 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS builder
|
||||
---> 18b460dd1754
|
||||
Step 11/35 : WORKDIR /src
|
||||
---> Using cache
|
||||
---> 1ba013278a4a
|
||||
Step 12/35 : RUN apk add --no-cache gcc musl-dev
|
||||
---> Using cache
|
||||
---> a0ea65f0bded
|
||||
Step 13/35 : COPY go.mod go.sum ./
|
||||
---> Using cache
|
||||
---> e98ccecfb093
|
||||
Step 14/35 : RUN go mod download
|
||||
---> Using cache
|
||||
---> 91d546c71507
|
||||
Step 15/35 : COPY cmd ./cmd
|
||||
---> Using cache
|
||||
---> b4e431a9d5f2
|
||||
Step 16/35 : COPY contracts ./contracts
|
||||
---> Using cache
|
||||
---> 958477d6c98e
|
||||
Step 17/35 : COPY dto ./dto
|
||||
---> Using cache
|
||||
---> d115fe2e1af4
|
||||
Step 18/35 : COPY internal ./internal
|
||||
---> 2f61826e3774
|
||||
Step 19/35 : COPY migrations ./migrations
|
||||
---> d96dd811bc83
|
||||
Step 20/35 : RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/messenger ./cmd
|
||||
---> Running in 3d7cd429d659
|
||||
---> Removed intermediate container 3d7cd429d659
|
||||
---> 2ad69db4c288
|
||||
Step 21/35 : RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/reconcile ./cmd/reconcile
|
||||
---> Running in 7b9a510ed472
|
||||
---> Removed intermediate container 7b9a510ed472
|
||||
---> 4a49dc2719a3
|
||||
Step 22/35 : FROM builder AS tests
|
||||
---> 4a49dc2719a3
|
||||
Step 23/35 : COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
---> 5df1413dfc44
|
||||
Step 24/35 : ENV GOOSE_MIGRATION_DIR=/src/migrations
|
||||
---> Running in c30eee45a5e7
|
||||
---> Removed intermediate container c30eee45a5e7
|
||||
---> 173325b59e7d
|
||||
Step 25/35 : CMD ["go", "test", "-p=1", "-race", "-count=1", "-v", "./..."]
|
||||
---> Running in 384e08125582
|
||||
---> Removed intermediate container 384e08125582
|
||||
---> 187ea6b3bcac
|
||||
Step 26/35 : FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616
|
||||
---> 075c2c1a4068
|
||||
Step 27/35 : RUN addgroup -S messenger && adduser -S -D -H -u 10001 -G messenger messenger
|
||||
---> Using cache
|
||||
---> 33192b561bfc
|
||||
Step 28/35 : COPY --from=builder --chown=messenger:messenger /out/messenger /usr/local/bin/messenger
|
||||
---> 37a18e0c6edf
|
||||
Step 29/35 : COPY --from=builder --chown=messenger:messenger /out/reconcile /usr/local/bin/reconcile
|
||||
---> b0e79d0416ba
|
||||
Step 30/35 : ENV PORT=8080
|
||||
---> Running in 48da45f81d52
|
||||
---> Removed intermediate container 48da45f81d52
|
||||
---> a7c04e9ff97b
|
||||
Step 31/35 : EXPOSE 8080
|
||||
---> Running in 671ff92f3fad
|
||||
---> Removed intermediate container 671ff92f3fad
|
||||
---> e56b07b42f04
|
||||
Step 32/35 : USER messenger:messenger
|
||||
---> Running in 8003e4ea3b5d
|
||||
---> Removed intermediate container 8003e4ea3b5d
|
||||
---> 48b4424b156b
|
||||
Step 33/35 : HEALTHCHECK --interval=10s --timeout=3s --start-period=3s --retries=3 CMD wget -q -O /dev/null "http://127.0.0.1:${PORT}/health/ready" || exit 1
|
||||
---> Running in c05d11001e2b
|
||||
---> Removed intermediate container c05d11001e2b
|
||||
---> 563fbe4dcd7d
|
||||
Step 34/35 : STOPSIGNAL SIGTERM
|
||||
---> Running in 8fb80a0e0f6c
|
||||
---> Removed intermediate container 8fb80a0e0f6c
|
||||
---> c5a0a88ba147
|
||||
Step 35/35 : ENTRYPOINT ["/usr/local/bin/messenger"]
|
||||
---> Running in 9e51b29d5939
|
||||
---> Removed intermediate container 9e51b29d5939
|
||||
---> c28dcd6e4410
|
||||
Successfully built c28dcd6e4410
|
||||
Successfully tagged mtusi-messenger:lab4
|
||||
@@ -0,0 +1,313 @@
|
||||
.venv/bin/python scripts/swarm.py up
|
||||
vphhh79vd5ti8501q6m9lzulj
|
||||
Local secrets are ready.
|
||||
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
|
||||
Install the buildx component to build images with BuildKit:
|
||||
https://docs.docker.com/go/buildx/
|
||||
|
||||
Sending build context to Docker daemon 398.8kB␍
|
||||
Step 1/20 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS minio-builder
|
||||
---> 18b460dd1754
|
||||
Step 2/20 : ADD --checksum=sha256:8b11129f6a6830768bcdebab569290ad956618f5ff6ef4857b633acb64f95126 https://codeload.github.com/minio/minio/tar.gz/01ce918d8279a20e4706b96a64396146894adee4 /tmp/source.tar.gz
|
||||
|
||||
|
||||
---> Using cache
|
||||
---> 4a2b9310629e
|
||||
Step 3/20 : RUN mkdir /src && tar -xzf /tmp/source.tar.gz -C /src --strip-components=1
|
||||
---> Using cache
|
||||
---> 5166de215d05
|
||||
Step 4/20 : WORKDIR /src
|
||||
---> Using cache
|
||||
---> 1f12c7444ff0
|
||||
Step 5/20 : RUN CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /out/minio .
|
||||
---> Using cache
|
||||
---> 8477e9d7324c
|
||||
Step 6/20 : RUN echo '8b11129f6a6830768bcdebab569290ad956618f5ff6ef4857b633acb64f95126 /tmp/source.tar.gz' | sha256sum -c -
|
||||
---> Using cache
|
||||
---> 94162de69c8c
|
||||
Step 7/20 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS mc-builder
|
||||
---> 18b460dd1754
|
||||
Step 8/20 : ADD --checksum=sha256:4cea8ed209c8f96e59ea1a5cc4901019b54c2be6d6f5f16c6749ea8bdcf4172e https://codeload.github.com/minio/mc/tar.gz/d6541ea280b73a834b64d4097e21f2be77676104 /tmp/source.tar.gz
|
||||
|
||||
|
||||
---> Using cache
|
||||
---> 5e135fc72a2c
|
||||
Step 9/20 : RUN mkdir /src && tar -xzf /tmp/source.tar.gz -C /src --strip-components=1
|
||||
---> Using cache
|
||||
---> cbffdcf35dd5
|
||||
Step 10/20 : WORKDIR /src
|
||||
---> Using cache
|
||||
---> 3322378e2ebd
|
||||
Step 11/20 : RUN CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /out/mc .
|
||||
---> Using cache
|
||||
---> 0aba858f1d48
|
||||
Step 12/20 : RUN echo '4cea8ed209c8f96e59ea1a5cc4901019b54c2be6d6f5f16c6749ea8bdcf4172e /tmp/source.tar.gz' | sha256sum -c -
|
||||
---> Using cache
|
||||
---> af0a57fdfed1
|
||||
Step 13/20 : FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616 AS minio
|
||||
---> 075c2c1a4068
|
||||
Step 14/20 : LABEL org.opencontainers.image.source="https://github.com/minio/minio" org.opencontainers.image.revision="01ce918d8279a20e4706b96a64396146894adee4" org.opencontainers.image.version="RELEASE.2025-09-07T16-13-09Z" org.opencontainers.image.licenses="AGPL-3.0"
|
||||
---> Using cache
|
||||
---> 57200264604d
|
||||
Step 15/20 : RUN mkdir /data && chown 10001:10001 /data
|
||||
---> Using cache
|
||||
---> c7024406f9a9
|
||||
Step 16/20 : COPY --from=minio-builder /out/minio /usr/local/bin/minio
|
||||
---> Using cache
|
||||
---> 0d1965ab7125
|
||||
Step 17/20 : COPY infra/minio-entrypoint.sh /usr/local/bin/start-minio
|
||||
---> Using cache
|
||||
---> e5c21da70a4f
|
||||
Step 18/20 : USER 10001:10001
|
||||
---> Using cache
|
||||
---> 9bc52122d9f2
|
||||
Step 19/20 : EXPOSE 9000
|
||||
---> Using cache
|
||||
---> 2ca448e77273
|
||||
Step 20/20 : ENTRYPOINT ["/usr/local/bin/start-minio"]
|
||||
---> Using cache
|
||||
---> 3a0797aa5ead
|
||||
Successfully built 3a0797aa5ead
|
||||
Successfully tagged mtusi-minio:RELEASE.2025-09-07T16-13-09Z
|
||||
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
|
||||
Install the buildx component to build images with BuildKit:
|
||||
https://docs.docker.com/go/buildx/
|
||||
|
||||
Sending build context to Docker daemon 398.8kB␍
|
||||
Step 1/25 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS minio-builder
|
||||
---> 18b460dd1754
|
||||
Step 2/25 : ADD --checksum=sha256:8b11129f6a6830768bcdebab569290ad956618f5ff6ef4857b633acb64f95126 https://codeload.github.com/minio/minio/tar.gz/01ce918d8279a20e4706b96a64396146894adee4 /tmp/source.tar.gz
|
||||
|
||||
|
||||
---> Using cache
|
||||
---> 4a2b9310629e
|
||||
Step 3/25 : RUN mkdir /src && tar -xzf /tmp/source.tar.gz -C /src --strip-components=1
|
||||
---> Using cache
|
||||
---> 5166de215d05
|
||||
Step 4/25 : WORKDIR /src
|
||||
---> Using cache
|
||||
---> 1f12c7444ff0
|
||||
Step 5/25 : RUN CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /out/minio .
|
||||
---> Using cache
|
||||
---> 8477e9d7324c
|
||||
Step 6/25 : RUN echo '8b11129f6a6830768bcdebab569290ad956618f5ff6ef4857b633acb64f95126 /tmp/source.tar.gz' | sha256sum -c -
|
||||
---> Using cache
|
||||
---> 94162de69c8c
|
||||
Step 7/25 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS mc-builder
|
||||
---> 18b460dd1754
|
||||
Step 8/25 : ADD --checksum=sha256:4cea8ed209c8f96e59ea1a5cc4901019b54c2be6d6f5f16c6749ea8bdcf4172e https://codeload.github.com/minio/mc/tar.gz/d6541ea280b73a834b64d4097e21f2be77676104 /tmp/source.tar.gz
|
||||
|
||||
|
||||
---> Using cache
|
||||
---> 5e135fc72a2c
|
||||
Step 9/25 : RUN mkdir /src && tar -xzf /tmp/source.tar.gz -C /src --strip-components=1
|
||||
---> Using cache
|
||||
---> cbffdcf35dd5
|
||||
Step 10/25 : WORKDIR /src
|
||||
---> Using cache
|
||||
---> 3322378e2ebd
|
||||
Step 11/25 : RUN CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /out/mc .
|
||||
---> Using cache
|
||||
---> 0aba858f1d48
|
||||
Step 12/25 : RUN echo '4cea8ed209c8f96e59ea1a5cc4901019b54c2be6d6f5f16c6749ea8bdcf4172e /tmp/source.tar.gz' | sha256sum -c -
|
||||
---> Using cache
|
||||
---> af0a57fdfed1
|
||||
Step 13/25 : FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616 AS minio
|
||||
---> 075c2c1a4068
|
||||
Step 14/25 : LABEL org.opencontainers.image.source="https://github.com/minio/minio" org.opencontainers.image.revision="01ce918d8279a20e4706b96a64396146894adee4" org.opencontainers.image.version="RELEASE.2025-09-07T16-13-09Z" org.opencontainers.image.licenses="AGPL-3.0"
|
||||
---> Using cache
|
||||
---> 57200264604d
|
||||
Step 15/25 : RUN mkdir /data && chown 10001:10001 /data
|
||||
---> Using cache
|
||||
---> c7024406f9a9
|
||||
Step 16/25 : COPY --from=minio-builder /out/minio /usr/local/bin/minio
|
||||
---> Using cache
|
||||
---> 0d1965ab7125
|
||||
Step 17/25 : COPY infra/minio-entrypoint.sh /usr/local/bin/start-minio
|
||||
---> Using cache
|
||||
---> e5c21da70a4f
|
||||
Step 18/25 : USER 10001:10001
|
||||
---> Using cache
|
||||
---> 9bc52122d9f2
|
||||
Step 19/25 : EXPOSE 9000
|
||||
---> Using cache
|
||||
---> 2ca448e77273
|
||||
Step 20/25 : ENTRYPOINT ["/usr/local/bin/start-minio"]
|
||||
---> Using cache
|
||||
---> 3a0797aa5ead
|
||||
Step 21/25 : FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616 AS mc
|
||||
---> 075c2c1a4068
|
||||
Step 22/25 : LABEL org.opencontainers.image.source="https://github.com/minio/mc" org.opencontainers.image.revision="d6541ea280b73a834b64d4097e21f2be77676104" org.opencontainers.image.version="RELEASE.2025-08-13T08-35-41Z" org.opencontainers.image.licenses="AGPL-3.0"
|
||||
---> Using cache
|
||||
---> 9257dca2de26
|
||||
Step 23/25 : COPY --from=mc-builder /out/mc /usr/local/bin/mc
|
||||
---> Using cache
|
||||
---> 4bea21e69e8d
|
||||
Step 24/25 : USER 10001:10001
|
||||
---> Using cache
|
||||
---> 45d00b9fce3e
|
||||
Step 25/25 : ENTRYPOINT ["mc"]
|
||||
---> Using cache
|
||||
---> 0713832dbf4a
|
||||
Successfully built 0713832dbf4a
|
||||
Successfully tagged mtusi-mc:RELEASE.2025-08-13T08-35-41Z
|
||||
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
|
||||
Install the buildx component to build images with BuildKit:
|
||||
https://docs.docker.com/go/buildx/
|
||||
|
||||
Sending build context to Docker daemon 398.3kB␍
|
||||
Step 1/35 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS goose-builder
|
||||
---> 18b460dd1754
|
||||
Step 2/35 : RUN GOBIN=/out CGO_ENABLED=0 go install -tags='no_clickhouse no_libsql no_mssql no_mysql no_sqlite3 no_vertica no_ydb no_spanner' github.com/pressly/goose/v3/cmd/goose@v3.27.1
|
||||
---> Using cache
|
||||
---> 7012ef857c0c
|
||||
Step 3/35 : FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616 AS migrations
|
||||
---> 075c2c1a4068
|
||||
Step 4/35 : COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
---> Using cache
|
||||
---> 6a0ad52336c1
|
||||
Step 5/35 : COPY migrations /migrations
|
||||
---> Using cache
|
||||
---> 19018c7bfac9
|
||||
Step 6/35 : COPY infra/migrate.sh /usr/local/bin/migrate
|
||||
---> Using cache
|
||||
---> 0cc075ba3459
|
||||
Step 7/35 : USER 10001:10001
|
||||
---> Using cache
|
||||
---> 37de51af32cd
|
||||
Step 8/35 : ENTRYPOINT ["/usr/local/bin/migrate"]
|
||||
---> Using cache
|
||||
---> e7539a967679
|
||||
Step 9/35 : CMD ["up"]
|
||||
---> Using cache
|
||||
---> 841d9bb239cd
|
||||
Step 10/35 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS builder
|
||||
---> 18b460dd1754
|
||||
Step 11/35 : WORKDIR /src
|
||||
---> Using cache
|
||||
---> 1ba013278a4a
|
||||
Step 12/35 : RUN apk add --no-cache gcc musl-dev
|
||||
---> Using cache
|
||||
---> a0ea65f0bded
|
||||
Step 13/35 : COPY go.mod go.sum ./
|
||||
---> Using cache
|
||||
---> e98ccecfb093
|
||||
Step 14/35 : RUN go mod download
|
||||
---> Using cache
|
||||
---> 91d546c71507
|
||||
Step 15/35 : COPY cmd ./cmd
|
||||
---> Using cache
|
||||
---> b4e431a9d5f2
|
||||
Step 16/35 : COPY contracts ./contracts
|
||||
---> Using cache
|
||||
---> 958477d6c98e
|
||||
Step 17/35 : COPY dto ./dto
|
||||
---> Using cache
|
||||
---> d115fe2e1af4
|
||||
Step 18/35 : COPY internal ./internal
|
||||
---> Using cache
|
||||
---> 72552b328db4
|
||||
Step 19/35 : COPY migrations ./migrations
|
||||
---> Using cache
|
||||
---> a68ac4a31860
|
||||
Step 20/35 : RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/messenger ./cmd
|
||||
---> Using cache
|
||||
---> 7303ceff230d
|
||||
Step 21/35 : RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/reconcile ./cmd/reconcile
|
||||
---> Using cache
|
||||
---> e6cc7991dac9
|
||||
Step 22/35 : FROM builder AS tests
|
||||
---> e6cc7991dac9
|
||||
Step 23/35 : COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
---> Using cache
|
||||
---> 5749aa2abe35
|
||||
Step 24/35 : ENV GOOSE_MIGRATION_DIR=/src/migrations
|
||||
---> Using cache
|
||||
---> ca0a6f733ba8
|
||||
Step 25/35 : CMD ["go", "test", "-p=1", "-race", "-count=1", "-v", "./..."]
|
||||
---> Using cache
|
||||
---> c643755b8aac
|
||||
Step 26/35 : FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616
|
||||
---> 075c2c1a4068
|
||||
Step 27/35 : RUN addgroup -S messenger && adduser -S -D -H -u 10001 -G messenger messenger
|
||||
---> Using cache
|
||||
---> 33192b561bfc
|
||||
Step 28/35 : COPY --from=builder --chown=messenger:messenger /out/messenger /usr/local/bin/messenger
|
||||
---> Using cache
|
||||
---> 136320eda1d3
|
||||
Step 29/35 : COPY --from=builder --chown=messenger:messenger /out/reconcile /usr/local/bin/reconcile
|
||||
---> Using cache
|
||||
---> 4acf2a8fc638
|
||||
Step 30/35 : ENV PORT=8080
|
||||
---> Using cache
|
||||
---> 6fbea06a8135
|
||||
Step 31/35 : EXPOSE 8080
|
||||
---> Using cache
|
||||
---> 333a62acf202
|
||||
Step 32/35 : USER messenger:messenger
|
||||
---> Using cache
|
||||
---> 60a29210a7f2
|
||||
Step 33/35 : HEALTHCHECK --interval=10s --timeout=3s --start-period=3s --retries=3 CMD wget -q -O /dev/null "http://127.0.0.1:${PORT}/health/ready" || exit 1
|
||||
---> Using cache
|
||||
---> 803ac1f944e5
|
||||
Step 34/35 : STOPSIGNAL SIGTERM
|
||||
---> Using cache
|
||||
---> 40299d0a0f9f
|
||||
Step 35/35 : ENTRYPOINT ["/usr/local/bin/messenger"]
|
||||
---> Using cache
|
||||
---> c81ae0702578
|
||||
Successfully built c81ae0702578
|
||||
Successfully tagged mtusi-messenger:lab4
|
||||
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
|
||||
Install the buildx component to build images with BuildKit:
|
||||
https://docs.docker.com/go/buildx/
|
||||
|
||||
Sending build context to Docker daemon 398.3kB␍
|
||||
Step 1/9 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS goose-builder
|
||||
---> 18b460dd1754
|
||||
Step 2/9 : RUN GOBIN=/out CGO_ENABLED=0 go install -tags='no_clickhouse no_libsql no_mssql no_mysql no_sqlite3 no_vertica no_ydb no_spanner' github.com/pressly/goose/v3/cmd/goose@v3.27.1
|
||||
---> Using cache
|
||||
---> 7012ef857c0c
|
||||
Step 3/9 : FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616 AS migrations
|
||||
---> 075c2c1a4068
|
||||
Step 4/9 : COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
---> Using cache
|
||||
---> 6a0ad52336c1
|
||||
Step 5/9 : COPY migrations /migrations
|
||||
---> Using cache
|
||||
---> 19018c7bfac9
|
||||
Step 6/9 : COPY infra/migrate.sh /usr/local/bin/migrate
|
||||
---> Using cache
|
||||
---> 0cc075ba3459
|
||||
Step 7/9 : USER 10001:10001
|
||||
---> Using cache
|
||||
---> 37de51af32cd
|
||||
Step 8/9 : ENTRYPOINT ["/usr/local/bin/migrate"]
|
||||
---> Using cache
|
||||
---> e7539a967679
|
||||
Step 9/9 : CMD ["up"]
|
||||
---> Using cache
|
||||
---> 841d9bb239cd
|
||||
Successfully built 841d9bb239cd
|
||||
Successfully tagged mtusi-migrations:lab4
|
||||
kkk3r78zn9bb09xudyehchs4p
|
||||
mtusi-lab4_migrations.0.mzx2ds4dsbyh@colima | 2026/10/28 19:14:47 OK 001_initial.sql (17.71ms)
|
||||
mtusi-lab4_migrations.0.mzx2ds4dsbyh@colima | 2026/10/28 19:14:47 OK 002_idempotency.sql (2.54ms)
|
||||
mtusi-lab4_migrations.0.mzx2ds4dsbyh@colima | 2026/10/28 19:14:47 OK 003_attachments.sql (5.13ms)
|
||||
mtusi-lab4_migrations.0.mzx2ds4dsbyh@colima | 2026/10/28 19:14:47 OK 004_message_attachments.sql (2.34ms)
|
||||
mtusi-lab4_migrations.0.mzx2ds4dsbyh@colima | 2026/10/28 19:14:47 goose: successfully migrated database to version: 4
|
||||
mtusi-lab4_migrations
|
||||
Since --detach=false was not specified, tasks will be created in the background.
|
||||
In a future release, --detach=false will become the default.
|
||||
Updating service mtusi-lab4_redis (id: zlhenabo1vgqarsazgqa6d897)
|
||||
Updating service mtusi-lab4_minio (id: ygvoo1fje6vqlxw02ugw7awa8)
|
||||
Updating service mtusi-lab4_api (id: xiueb8lcewfukmzn8wocqcmjh)
|
||||
Updating service mtusi-lab4_lb (id: uo65o8allz5azrqbx4zchi811)
|
||||
Updating service mtusi-lab4_postgres (id: vxi6yu73ah85o0xog5w8r1t5k)
|
||||
f6qbximmjnxx8ezv05jxgsngz
|
||||
mtusi-lab4_s3-bootstrap.0.p9vksdlsfz2l@colima | PASS: private bucket and restricted API account configured.
|
||||
mtusi-lab4_s3-bootstrap
|
||||
mtusi-lab4_api scaled to 2
|
||||
mtusi-lab4_api
|
||||
PASS: rolling update completed
|
||||
PASS: Swarm stack ready at http://localhost:8080
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"docker_engine": {
|
||||
"cpus": 2,
|
||||
"memory_bytes": 2053644288,
|
||||
"os": "Ubuntu 24.04.4 LTS",
|
||||
"kernel": "6.8.0-117-generic",
|
||||
"architecture": "aarch64",
|
||||
"version": "29.5.2"
|
||||
},
|
||||
"host": {
|
||||
"architecture": "arm64",
|
||||
"system": "Darwin",
|
||||
"model": "MacBookPro18,3",
|
||||
"cpu_cores": 8,
|
||||
"memory_bytes": 17179869184
|
||||
},
|
||||
"host_go": "go version go1.27.2 darwin/arm64",
|
||||
"host_python": "3.9.6",
|
||||
"images": [
|
||||
{
|
||||
"tag": "mtusi-messenger:lab4",
|
||||
"image_id": "sha256:c28dcd6e4410ee011a827852286b93296c8a0f20ddb268524b4d92371014403e",
|
||||
"repo_digests": [
|
||||
"mtusi-messenger@sha256:c28dcd6e4410ee011a827852286b93296c8a0f20ddb268524b4d92371014403e"
|
||||
],
|
||||
"source_labels": {}
|
||||
},
|
||||
{
|
||||
"tag": "mtusi-minio:RELEASE.2025-09-07T16-13-09Z",
|
||||
"image_id": "sha256:3a0797aa5eadafe23e8a7b205c39511a9280b7500da6ef0e5d604cc74f46c3ed",
|
||||
"repo_digests": [
|
||||
"mtusi-minio@sha256:3a0797aa5eadafe23e8a7b205c39511a9280b7500da6ef0e5d604cc74f46c3ed"
|
||||
],
|
||||
"source_labels": {
|
||||
"org.opencontainers.image.licenses": "AGPL-3.0",
|
||||
"org.opencontainers.image.revision": "01ce918d8279a20e4706b96a64396146894adee4",
|
||||
"org.opencontainers.image.source": "https://github.com/minio/minio",
|
||||
"org.opencontainers.image.version": "RELEASE.2025-09-07T16-13-09Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "mtusi-mc:RELEASE.2025-08-13T08-35-41Z",
|
||||
"image_id": "sha256:0713832dbf4ab9a3b716ab0a4cca6629fec96224bc1425f26ab6ba42c5463a99",
|
||||
"repo_digests": [
|
||||
"mtusi-mc@sha256:0713832dbf4ab9a3b716ab0a4cca6629fec96224bc1425f26ab6ba42c5463a99"
|
||||
],
|
||||
"source_labels": {
|
||||
"org.opencontainers.image.licenses": "AGPL-3.0",
|
||||
"org.opencontainers.image.revision": "d6541ea280b73a834b64d4097e21f2be77676104",
|
||||
"org.opencontainers.image.source": "https://github.com/minio/mc",
|
||||
"org.opencontainers.image.version": "RELEASE.2025-08-13T08-35-41Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "postgres:17.6-alpine3.22",
|
||||
"image_id": "sha256:ef257d85f76e48da1c64832459b59fcaba1a4dac97bf5d7450c77753542eee94",
|
||||
"repo_digests": [
|
||||
"postgres@sha256:ef257d85f76e48da1c64832459b59fcaba1a4dac97bf5d7450c77753542eee94"
|
||||
],
|
||||
"source_labels": {}
|
||||
},
|
||||
{
|
||||
"tag": "redis:7.4.5-alpine3.21",
|
||||
"image_id": "sha256:bb186d083732f669da90be8b0f975a37812b15e913465bb14d845db72a4e3e08",
|
||||
"repo_digests": [
|
||||
"redis@sha256:bb186d083732f669da90be8b0f975a37812b15e913465bb14d845db72a4e3e08"
|
||||
],
|
||||
"source_labels": {}
|
||||
},
|
||||
{
|
||||
"tag": "haproxy:3.2.6-alpine",
|
||||
"image_id": "sha256:3a819392f5a6af2a9203d1c63ff0feba74f0c940623a558511be06d7d85e361c",
|
||||
"repo_digests": [
|
||||
"haproxy@sha256:3a819392f5a6af2a9203d1c63ff0feba74f0c940623a558511be06d7d85e361c"
|
||||
],
|
||||
"source_labels": {}
|
||||
}
|
||||
],
|
||||
"go_container_version": "1.26.4",
|
||||
"test_data": "synthetic; no credentials/tokens saved"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
.venv/bin/python tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8080"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 112, "failed_attempts": 2, "first_recovery_seconds": 2.061}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
@@ -0,0 +1,13 @@
|
||||
? gitflic.ru/akselbant/mtusi2026lab1-fork/cmd [no test files]
|
||||
? gitflic.ru/akselbant/mtusi2026lab1-fork/cmd/reconcile [no test files]
|
||||
? gitflic.ru/akselbant/mtusi2026lab1-fork/contracts [no test files]
|
||||
ok gitflic.ru/akselbant/mtusi2026lab1-fork/dto (cached)
|
||||
ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/app/chat 13.184s
|
||||
ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/attachment 2.905s
|
||||
? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/config [no test files]
|
||||
? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain [no test files]
|
||||
ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/password (cached)
|
||||
? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/repository [no test files]
|
||||
ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/repository/postgres 2.388s
|
||||
? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/session [no test files]
|
||||
ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/usecase/chat (cached)
|
||||
@@ -0,0 +1,338 @@
|
||||
.venv/bin/python scripts/swarm.py test-integration
|
||||
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
|
||||
Install the buildx component to build images with BuildKit:
|
||||
https://docs.docker.com/go/buildx/
|
||||
|
||||
Sending build context to Docker daemon 398.3kB␍
|
||||
Step 1/25 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS goose-builder
|
||||
---> 18b460dd1754
|
||||
Step 2/25 : RUN GOBIN=/out CGO_ENABLED=0 go install -tags='no_clickhouse no_libsql no_mssql no_mysql no_sqlite3 no_vertica no_ydb no_spanner' github.com/pressly/goose/v3/cmd/goose@v3.27.1
|
||||
---> Using cache
|
||||
---> 7012ef857c0c
|
||||
Step 3/25 : FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616 AS migrations
|
||||
---> 075c2c1a4068
|
||||
Step 4/25 : COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
---> Using cache
|
||||
---> 6a0ad52336c1
|
||||
Step 5/25 : COPY migrations /migrations
|
||||
---> Using cache
|
||||
---> 19018c7bfac9
|
||||
Step 6/25 : COPY infra/migrate.sh /usr/local/bin/migrate
|
||||
---> Using cache
|
||||
---> 0cc075ba3459
|
||||
Step 7/25 : USER 10001:10001
|
||||
---> Using cache
|
||||
---> 37de51af32cd
|
||||
Step 8/25 : ENTRYPOINT ["/usr/local/bin/migrate"]
|
||||
---> Using cache
|
||||
---> e7539a967679
|
||||
Step 9/25 : CMD ["up"]
|
||||
---> Using cache
|
||||
---> 841d9bb239cd
|
||||
Step 10/25 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS builder
|
||||
---> 18b460dd1754
|
||||
Step 11/25 : WORKDIR /src
|
||||
---> Using cache
|
||||
---> 1ba013278a4a
|
||||
Step 12/25 : RUN apk add --no-cache gcc musl-dev
|
||||
---> Using cache
|
||||
---> a0ea65f0bded
|
||||
Step 13/25 : COPY go.mod go.sum ./
|
||||
---> Using cache
|
||||
---> e98ccecfb093
|
||||
Step 14/25 : RUN go mod download
|
||||
---> Using cache
|
||||
---> 91d546c71507
|
||||
Step 15/25 : COPY cmd ./cmd
|
||||
---> Using cache
|
||||
---> b4e431a9d5f2
|
||||
Step 16/25 : COPY contracts ./contracts
|
||||
---> Using cache
|
||||
---> 958477d6c98e
|
||||
Step 17/25 : COPY dto ./dto
|
||||
---> Using cache
|
||||
---> d115fe2e1af4
|
||||
Step 18/25 : COPY internal ./internal
|
||||
---> Using cache
|
||||
---> 72552b328db4
|
||||
Step 19/25 : COPY migrations ./migrations
|
||||
---> Using cache
|
||||
---> a68ac4a31860
|
||||
Step 20/25 : RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/messenger ./cmd
|
||||
---> Using cache
|
||||
---> 7303ceff230d
|
||||
Step 21/25 : RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/reconcile ./cmd/reconcile
|
||||
---> Using cache
|
||||
---> e6cc7991dac9
|
||||
Step 22/25 : FROM builder AS tests
|
||||
---> e6cc7991dac9
|
||||
Step 23/25 : COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
---> Using cache
|
||||
---> 5749aa2abe35
|
||||
Step 24/25 : ENV GOOSE_MIGRATION_DIR=/src/migrations
|
||||
---> Using cache
|
||||
---> ca0a6f733ba8
|
||||
Step 25/25 : CMD ["go", "test", "-p=1", "-race", "-count=1", "-v", "./..."]
|
||||
---> Using cache
|
||||
---> c643755b8aac
|
||||
Successfully built c643755b8aac
|
||||
Successfully tagged mtusi-messenger-tests:lab4
|
||||
qs9c5xskdu6nyjiv287eg68b8
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/cmd [no test files]
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/cmd/reconcile [no test files]
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/contracts [no test files]
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestMessageStrictFields
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestMessageStrictFields (0.00s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestTimestampFixedMicroseconds
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestTimestampFixedMicroseconds (0.00s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | PASS
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/dto 1.013s
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestRejectsMalformedJSON
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:40 request_id=94533522-1e48-4953-9857-91c107c2aac7 method=POST path=/api/v1/users status=400 response_bytes=140 latency=130.671µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestRejectsMalformedJSON (0.01s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestHidesForeignChat
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:40 request_id=8b136f4b-a1b6-4756-9dda-92871979845c method=POST path=/api/v1/users status=201 response_bytes=141 latency=369.112982ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:41 request_id=df98ca4b-5f1f-4ef1-a8eb-7708ccfe2367 method=POST path=/api/v1/auth/sessions status=201 response_bytes=269 latency=397.145342ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:41 request_id=c535a54a-6ce6-49b0-8ec7-47e70ea04799 method=POST path=/api/v1/users status=201 response_bytes=147 latency=364.216754ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:41 request_id=fea0410a-7349-4fc3-8541-f479066736b7 method=POST path=/api/v1/auth/sessions status=201 response_bytes=275 latency=359.930021ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:41 request_id=b7201791-c957-4ee8-8237-2aab675777ec method=POST path=/api/v1/chats status=201 response_bytes=163 latency=174.381µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:41 request_id=30b379c6-e33c-42bc-963a-54de252a1e44 method=GET path=/api/v1/chats/:chat_id status=404 response_bytes=126 latency=53.002µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestHidesForeignChat (1.50s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestRejectsEmptyMessage
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:42 request_id=92d81694-3fcf-452b-be3d-24e21f938fb8 method=POST path=/api/v1/users status=201 response_bytes=157 latency=411.707889ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:42 request_id=792cc573-4974-4744-86bc-7ce29f78c5a2 method=POST path=/api/v1/auth/sessions status=201 response_bytes=285 latency=357.462544ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:42 request_id=4aec085d-f3fe-4b56-a0f2-b6bb55c32fd5 method=POST path=/api/v1/chats status=201 response_bytes=163 latency=135.922µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:42 request_id=bae49af4-9cb9-414e-8227-7991f680a0ab method=POST path=/api/v1/chats/:chat_id/messages status=400 response_bytes=172 latency=150.047µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestRejectsEmptyMessage (0.77s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestRejectsDuplicateUsername
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:42 request_id=c6f9b126-b2a0-4672-b4de-a59183cffe86 method=POST path=/api/v1/users status=201 response_bytes=149 latency=370.366912ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:43 request_id=c174982c-6a8d-4fc7-8d4b-6cbe68b34d70 method=POST path=/api/v1/auth/sessions status=201 response_bytes=277 latency=365.829696ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:43 request_id=b8771b83-4e05-4335-a6bd-4de115eb5e20 method=POST path=/api/v1/users status=409 response_bytes=170 latency=358.448604ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestRejectsDuplicateUsername (1.10s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestPaginatesMessagesAcrossMultiplePages
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:44 request_id=fb5f658b-7688-4017-9758-bea1d60af1cf method=POST path=/api/v1/users status=201 response_bytes=151 latency=366.583521ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:44 request_id=ddf8c2e9-34d2-4b17-aaa5-66ee679b9a4b method=POST path=/api/v1/auth/sessions status=201 response_bytes=279 latency=393.325397ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:44 request_id=32abde1e-d2e7-46fe-ad10-210533f83bd5 method=POST path=/api/v1/chats status=201 response_bytes=163 latency=136.838µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:44 request_id=227b702f-3d9d-4307-a1a8-30ab4f7aa8f2 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=217.05µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:44 request_id=edc8c38d-6beb-4353-b6c1-d1c8f337282b method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=132.629µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:44 request_id=27b25c6f-8b85-4f74-9a26-bc175b6e490f method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=120.337µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:44 request_id=148f8872-b793-4898-a57f-78f66d57fbb6 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=115.879µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:44 request_id=d2b4fae7-2633-4406-920a-af6bad40e7c9 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=113.254µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:44 request_id=65190391-2026-4f9e-b907-b52379ad8afe method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=141.005µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:44 request_id=094c52b2-7bb7-4ba0-be47-2695d64f4867 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=181.464µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:44 request_id=ebf5592b-9a0e-4ea4-8fa7-b7d2eb14639e method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=725 latency=304.594µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:44 request_id=c0d34ec3-f7c3-4639-8160-d6e32d09ff42 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=725 latency=180.132µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:44 request_id=0e2daae8-eec7-4e5e-a222-2f11927517a0 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=725 latency=168.339µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:44 request_id=b8dc3150-f39e-4d7b-a0af-38ffa5a8936d method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=259 latency=110.796µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestPaginatesMessagesAcrossMultiplePages (0.77s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestConcurrentMessagesAreUnique
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:44 request_id=a35f6c93-191f-4fe2-8640-6390ceab09fc method=POST path=/api/v1/users status=201 response_bytes=153 latency=372.343576ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:45 request_id=4dd49805-f2ef-4166-b188-ebbbc1924d9a method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=371.622652ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:45 request_id=745e9e01-1f34-4e95-81fe-6a3ae7cf9ea4 method=POST path=/api/v1/users status=201 response_bytes=153 latency=394.884355ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:45 request_id=95ac49aa-2560-42da-90c1-902d76341ccd method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=358.911214ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:46 request_id=249bef9d-e9fb-462a-99c3-1946037d1d0c method=POST path=/api/v1/users status=201 response_bytes=153 latency=374.597959ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:46 request_id=ef3349aa-4db5-4ab6-998e-50fa2f3262bb method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=364.93841ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:47 request_id=3007dbff-cdb7-42b9-ac50-77dc7c2ebc4f method=POST path=/api/v1/users status=201 response_bytes=153 latency=396.618954ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:47 request_id=01f269ef-e3c5-4240-9070-37312feb0e6b method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=372.262695ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:47 request_id=ab7c6c66-e836-4704-a516-3c4b51322e74 method=POST path=/api/v1/users status=201 response_bytes=153 latency=358.500208ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:48 request_id=b5f8edd3-d534-401f-8e68-fac601795f3f method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=369.620285ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:48 request_id=1362a848-874b-4b9b-b7fe-735ae74cc76d method=POST path=/api/v1/users status=201 response_bytes=153 latency=401.141119ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:49 request_id=953f6f2b-9fd3-49c5-b660-94a56615c24c method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=376.048273ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:49 request_id=56532a32-ca19-4238-b539-486b339d0bbb method=POST path=/api/v1/users status=201 response_bytes=153 latency=365.0437ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:49 request_id=89c7cf01-2523-4ae6-9a85-dd1a76a61039 method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=362.393272ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:50 request_id=0af98040-fde9-4694-a646-c60f794e097f method=POST path=/api/v1/users status=201 response_bytes=153 latency=360.604883ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:50 request_id=92c16b19-7579-47aa-9fb0-a3595b644fc7 method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=373.615906ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:50 request_id=460293e1-83ce-4a90-9255-cea43854fe3f method=POST path=/api/v1/users status=201 response_bytes=153 latency=366.494027ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=f564332d-7da7-40c0-9842-20cf89412495 method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=375.265646ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=62b8365d-f837-4354-8383-1456f1b72154 method=POST path=/api/v1/users status=201 response_bytes=153 latency=358.727985ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=a2a37a46-5e62-41e6-bfa3-2bce4c2e3ad8 method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=395.19545ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=5267f89c-aaf1-47b4-8c6a-9714ca727915 method=POST path=/api/v1/chats status=201 response_bytes=514 latency=188.799µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=c5b24f54-0511-46a1-82e5-0061ec77cb32 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=208.924µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=f72ec60f-87ae-4bf6-b996-ce192a118119 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=159.047µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=8afe7b58-5dce-42a1-adf2-1145ac360d45 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=148.63µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=7b09b2e8-26b4-42af-bee4-016a8e269a6b method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=160.922µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=81276d1e-5a76-4f9b-a7aa-f9857012dc26 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=260.717µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=8904e3d2-be95-47dc-a2fa-d3eaf50a3578 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=142.714µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=a03ae327-db89-4091-b3af-578a51335de2 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=216.716µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=a498db7b-49fb-4935-bb51-891c908fa4f8 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=139.089µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=2c981e76-6d36-494c-89ba-3336d357095d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=140.255µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=b9b68e40-c117-4bc7-8f41-b16dd197571a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=150.047µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=7223bf26-18da-419a-a853-3b50f5f04a4b method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=132.047µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=16cc739c-a6a1-4c4c-a0bb-ec393bab1534 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=162.423µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=0aef904a-3e95-41de-b5b4-0bff73ed6722 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=153.297µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=25534c61-60fe-4374-bfda-db1354ea6012 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=145.714µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=53c00161-1317-49e3-84db-eb7c99300efa method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=146.422µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=1adf4594-5a16-4773-bff0-1b097ab75276 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=133.63µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=78902daf-2bbe-4307-a4d3-e6e9042a6291 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=180.09µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=7d53cfa6-047a-48c8-8fef-59024e131a96 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=185.173µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=b2942d4f-3e6a-4c91-8dbf-a32c6af07f43 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=206.424µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=5760c94c-8ecd-4067-832b-11909584e440 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=266.593µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=2b89e564-7bdd-4d5f-9e78-78445d1cbf70 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=153.922µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=f8fe6364-dab9-4122-9364-cc8a4e8e3d75 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=208.757µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=3af65a8b-625c-4fc7-ac62-bfbc353ac7a6 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=151.214µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=755c991e-1d9e-4279-b187-d607b13823ff method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=159.422µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=c36f80e6-63d2-4dc5-a2ee-01e6ab546ef3 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=245.509µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=e03d69f4-1738-49f5-b579-cdf4a632cc45 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=153.131µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=05255c0a-5b54-4b53-b714-08f15260687e method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=180.423µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=70f18e4c-0cdf-40a9-9e45-048f73171b1d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=126.796µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=ed2a3480-d27e-44eb-bc85-bd088d0cd3a3 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=192.631µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=51c5b7ad-f0a6-4127-aca2-1d300b973d21 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=214.091µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=e8718af1-4fbd-4b3b-8189-9c066828773c method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=151.922µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=cd61dc79-f672-45c5-91a5-797ac5bd8680 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=170.214µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=e9226bfb-5572-4513-9a97-0e90e532cec1 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=129.838µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=8286f6ba-c4cc-4eb9-8b10-da07785cf32a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=164.173µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=d85b2fd6-05bf-4f9b-818a-09ca9ae2df48 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=142.005µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=0ba6f4c9-0162-48d9-b610-bf28b56d39cd method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=144.339µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=296d49e0-2b8b-4493-9835-bee0c4f23261 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=243.426µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=9cf7e296-e25f-4d63-a1db-de1c262e2b8c method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=208.632µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=8fa7d17d-40d0-4dc6-a4bd-b6c514bceb4a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=133.171µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=9e1b6e9b-7487-446f-b948-175f7d88e714 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=163.506µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=3cf21baa-455a-4dac-b8c2-732150d32af8 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=323.762µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=688c501c-30c9-46bc-ba4d-9d6a9202200d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=572.521µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=65eefba1-b010-405b-b534-8e30d577d755 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=503.852µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=988807ed-875a-4d13-be2c-eb083546e583 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=193.299µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=0ae6f088-d7cb-4d57-a3db-bedb1d222bc7 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=129.088µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=038588a3-1ed6-4c91-bb8c-de5e55113175 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=320.887µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=ff151126-07e7-4100-a2af-e9765d071ca2 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=762.652µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=4cf0b177-670d-41b1-aa74-dafd209611e3 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=202.549µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=f893e111-2ccc-49a7-a34e-38c8248d5f3b method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=145.422µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=ece5e0f5-e795-4d1e-8bfe-2722feed55f7 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=150.047µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=45f9158b-a65f-4527-a741-2a8b3af800ac method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=165.089µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=ddc311c8-9d3f-4977-a159-a4d1daff9bf9 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=166.298µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=a0ab6cc9-4a7d-471e-9b65-932e3089cbc7 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=165.84µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=76e8f478-d9dc-4443-9bb8-310b8e9dd45a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=266.51µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=96cb53f0-70bd-45aa-b735-6b5003310461 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=353.721µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=f1dda2fb-4016-440f-9fb6-c95a024038e6 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=169.048µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=e553ec3c-0ab2-4007-8363-48f94f36f000 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=141.796µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=78043ec3-1ec7-4c62-970c-950382757345 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=187.298µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=6222f780-9cdf-4d85-b99b-2897e61cbc43 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=808.862µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=73702805-906e-46ed-b38a-0206be2646dc method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=695.567µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=1186e970-9cb0-4db8-a44e-6d823c940ba7 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=410.557µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=98aaedba-db19-4504-a633-8a057f94d54e method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=311.22µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=92a3bfc9-1577-4a57-9bdd-351208fd7d93 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.151249ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=015c2bd0-266c-478a-99c8-516c482aeebe method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=266.801µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=664b2b6c-39ae-46d5-bed9-72caa9acb7f2 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=249.759µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=286c54ea-04d6-4af2-b00e-8ab00720b2ac method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=273.885µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=89ab422c-a181-43b7-8e4c-cbcdfe3c18b0 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.459927ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=9bbdd304-3f76-4f00-85bb-3c964aefb553 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=334.178µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:51 request_id=52dcf62b-df81-4c8f-8b60-c54965aaa140 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.887567ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=68f8ee3e-6eec-4f40-9428-dbeff99fd58a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.955945ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=efa4cdeb-c02b-4332-a745-9ba14b490f76 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=2.642094ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=73f2e45a-8d59-4540-b193-98f1a4dca76a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=486.101µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=c74d1c30-bde3-46d2-9b37-566419bf5376 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=507.602µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=65789068-cb57-4684-82d8-e201be139913 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=2.130868ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=fcffe674-7c32-4ee1-b34f-3841ac041030 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=191.966µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=5ea31e02-1c46-4305-ad02-1fa2217b9738 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=4.155481ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=b281c62b-cbeb-4e81-9c96-40757c5a88bf method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=150.547µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=5aceee05-4b98-45ca-974a-1e919fdde991 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=131.963µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=f82374a1-7d40-403d-aa70-5de8f913d2cc method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=167.798µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=5a725d61-e66a-445b-9b40-57ba6183a195 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=207.841µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=8ab66e91-8556-454b-913e-7b2c130dfd8e method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=152.631µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=423f02cb-0169-42fd-a1ed-5b6952cb262d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=132.88µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=7da7d9d5-13e8-4495-9ec8-18ef6966bd41 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=160.839µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=870557ee-8823-4a7a-b78e-a440a1d8a0f7 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=146.588µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=52f91333-d9c9-4365-9453-cdfcb0c3f5a7 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=146.172µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=af8b17fd-7edc-4208-a40d-84ca21e160f3 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=167.798µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=d4c625e7-5ebf-4eea-8d60-45af463edf4c method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=165.798µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=083768b9-8f2a-4681-bcd4-5ae52228e0bb method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=186.59µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=46101c43-7641-481a-869d-3543f25ef54d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=436.099µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=ba6ff758-a13f-4580-8ba2-da63a2351ca8 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=162.255µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=e6379b05-1acd-4b5a-b5a6-99e7bccc5f01 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=134.672µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=d9fb6747-2b9e-41cf-b53c-1a7750fc91f0 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=202.966µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=e5e5ec36-88eb-412f-8c2c-3f82c87c4590 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=171.006µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=8c2d9c31-df32-49d8-9c38-780f4fab1746 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=184.465µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=95fd52ea-b8d8-45df-a68a-ceba9d27b133 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=135.922µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=ae9ee763-096d-480c-b24b-cd349cb18978 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=384.431µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=088337f5-bb46-4911-80fd-fa855dc98200 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=145.463µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=2aa7e674-07c8-4282-8798-fcf641d08133 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=138.797µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=e0339717-77bb-4bd7-a321-34eaf1984fb9 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=163.923µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=74331de8-09a1-4057-8604-bd04d68465f4 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=145.922µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=da1793af-1f78-46eb-8751-52961c9bd4af method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=4332 latency=865.156µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=41cc821a-71d8-48f3-a2ec-618e8d6370b3 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=4332 latency=796.404µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=58db51d8-2b41-4a61-9f48-e28a79b88470 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=4332 latency=728.859µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=6b05dcf0-ee67-43cf-96d4-ef406c94761e method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=4332 latency=616.272µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=8bbd35fc-09c2-4ede-af22-3fb7147d5620 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=4332 latency=611.938µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:52 request_id=10bfa4c2-537d-442a-8e5b-0da397c81cc0 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=3616 latency=446.391µs
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestConcurrentMessagesAreUnique (7.52s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | PASS
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/app/chat 12.755s
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestSpoolOriginalAndFullValidation
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestSpoolOriginalAndFullValidation (0.00s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestSpoolLimitsBeforeDecode
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestSpoolLimitsBeforeDecode (0.02s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestFilenameAndCancelledUpload
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestFilenameAndCancelledUpload (0.00s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestReconcileRejectsUnsafeGrace
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestReconcileRejectsUnsafeGrace (0.00s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestValid16BitWidePNG
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestValid16BitWidePNG (0.08s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | PASS
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/attachment 1.160s
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/config [no test files]
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain [no test files]
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestUnicodeAndSalt
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestUnicodeAndSalt (2.23s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | PASS
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/password 3.266s
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/repository [no test files]
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestS3WireFixture
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestS3WireFixture (0.00s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestIntegration
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:84: goose up: 2026/10/28 19:17:59 OK 001_initial.sql (24.32ms)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:59 OK 002_idempotency.sql (1.98ms)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:59 OK 003_attachments.sql (4.14ms)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:59 OK 004_message_attachments.sql (1.77ms)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:59 goose: successfully migrated database to version: 4
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:85: goose up: 2026/10/28 19:17:59 goose: no migrations to run. current version: 4
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestIntegration/registration_race
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:121: 12 concurrent INSERTs: 1 success, 11 unique conflicts
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestIntegration/rollback
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:139: failed second member INSERT left 0 chats and 0 members
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestIntegration/lab4_attachments_and_reconciliation
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | lab4_test.go:248: ACL, original bytes, cross-chat attachment rejection, ordered/concurrent idempotency and absent=[] passed
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | lab4_test.go:316: dry-run={Apply:false GraceSeconds:90 ObjectsScanned:4 MetadataScanned:2 BytesScanned:94 ListRequestsEstimate:1 StatRequests:3 DBQueries:12 Orphans:1 Missing:1 FreshSkipped:1 LockedSkipped:1 ReferencedMissing:1 Deleted:0 MarkedFailed:0 DurationMS:7 Actions:[{Kind:orphan Key:original/9da5bf1b-bbc2-4c8e-8816-d473c908db4a Applied:false} {Kind:missing Key:original/65f5dff4-bc2f-469b-8b6b-6bc1275f8d6a Applied:false}]} apply={Apply:true GraceSeconds:90 ObjectsScanned:4 MetadataScanned:2 BytesScanned:94 ListRequestsEstimate:1 StatRequests:3 DBQueries:13 Orphans:1 Missing:1 FreshSkipped:1 LockedSkipped:1 ReferencedMissing:1 Deleted:1 MarkedFailed:1 DurationMS:5 Actions:[{Kind:orphan Key:original/9da5bf1b-bbc2-4c8e-8816-d473c908db4a Applied:true} {Kind:missing Key:original/65f5dff4-bc2f-469b-8b6b-6bc1275f8d6a Applied:true}]} repeat={Apply:true GraceSeconds:90 ObjectsScanned:3 MetadataScanned:2 BytesScanned:88 ListRequestsEstimate:1 StatRequests:1 DBQueries:7 Orphans:0 Missing:0 FreshSkipped:1 LockedSkipped:1 ReferencedMissing:0 Deleted:0 MarkedFailed:0 DurationMS:2 Actions:[]}; fresh, locked and referenced objects retained
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestIntegration/keyset_and_explain
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:193: EXPLAIN on 10,000 messages, cursor near the end (9,000):
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:199: Limit (cost=0.29..18.05 rows=51 width=142) (actual time=0.011..0.032 rows=51 loops=1)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:199: Buffers: shared hit=10
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:199: -> Index Scan using messages_history_idx on messages m (cost=0.29..348.68 rows=1000 width=142) (actual time=0.011..0.028 rows=51 loops=1)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:199: Index Cond: ((chat_id = '3945a437-ac3b-4af6-a505-e156a979dd08'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.9+00'::timestamp with time zone, '00000000-0000-0000-0000-000000000000'::uuid)))
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:199: Buffers: shared hit=10
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:199: Planning Time: 0.031 ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:199: Execution Time: 0.061 ms
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:204: keyset traversal returned 10,000 distinct messages, including equal timestamps
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestIntegration/idempotency_race
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:254: 16 concurrent PostgreSQL requests: one effect, identical replay, changed body conflicts
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestIntegration/goose_legacy_and_down
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:268: goose up: 2026/10/28 19:17:59 OK 001_initial.sql (1.62ms)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:59 OK 002_idempotency.sql (1.13ms)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:59 OK 003_attachments.sql (583.4µs)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:59 OK 004_message_attachments.sql (2.74ms)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:59 goose: successfully migrated database to version: 4
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:269: goose up: 2026/10/28 19:17:59 goose: no migrations to run. current version: 4
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:276: adopted legacy schema: all existing messages are unchanged
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:277: goose reset: 2026/10/28 19:17:59 OK 004_message_attachments.sql (5.92ms)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:59 OK 003_attachments.sql (3.96ms)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:59 OK 002_idempotency.sql (2.73ms)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:59 OK 001_initial.sql (9.78ms)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:282: goose up: 2026/10/28 19:17:59 OK 001_initial.sql (10.62ms)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:59 OK 002_idempotency.sql (1.69ms)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:59 OK 003_attachments.sql (3.22ms)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:59 OK 004_message_attachments.sql (1.21ms)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | 2026/10/28 19:17:59 goose: successfully migrated database to version: 4
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | storage_test.go:286: down and up succeeded in isolated schema
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestIntegration (0.64s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestIntegration/registration_race (0.04s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestIntegration/rollback (0.00s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestIntegration/lab4_attachments_and_reconciliation (0.04s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestIntegration/keyset_and_explain (0.08s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestIntegration/idempotency_race (0.01s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestIntegration/goose_legacy_and_down (0.12s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | PASS
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/repository/postgres 1.675s
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/session [no test files]
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | === RUN TestPasswordContract
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | --- PASS: TestPasswordContract (0.00s)
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | PASS
|
||||
mtusi-lab4_tests.0.lks3m3xxmw5s@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/usecase/chat 1.011s
|
||||
mtusi-lab4_tests
|
||||
@@ -0,0 +1,3 @@
|
||||
.venv/bin/python 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.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
.venv/bin/python tests/own/reconcile.py
|
||||
Fresh scan cost: {"objects_scanned": 130, "metadata_scanned": 30, "list_requests_estimate": 1, "stat_requests": 7, "db_queries": 30, "duration_ms": 27}
|
||||
Fresh scan cost: {"objects_scanned": 1130, "metadata_scanned": 30, "list_requests_estimate": 2, "stat_requests": 7, "db_queries": 30, "duration_ms": 64}
|
||||
Waiting92s for actual S3 timestamps: measuring aged-object locking, DB and HEAD cost next.
|
||||
Aged scan cost: {"objects_scanned": 1130, "metadata_scanned": 30, "list_requests_estimate": 2, "stat_requests": 1131, "db_queries": 2323, "duration_ms": 999}
|
||||
Aged scan cost: {"objects_scanned": 130, "metadata_scanned": 30, "list_requests_estimate": 1, "stat_requests": 131, "db_queries": 323, "duration_ms": 129}
|
||||
PASS: real two-store faults, grace, lock, dry-run/apply/repeat, linked data preserved and paginated scan cost.
|
||||
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"api": {
|
||||
"all_original_tasks_replaced": true,
|
||||
"mounts_unchanged": true,
|
||||
"before": [
|
||||
"05qp70hqicx1m3uten0t88c9p",
|
||||
"1diq18xi0jmwpzqzhhq39hjad"
|
||||
],
|
||||
"after": [
|
||||
"g2s34c3zuztbxehcxyypsyrxy",
|
||||
"rz3qizaxp0s2bguzbs57me0op"
|
||||
]
|
||||
},
|
||||
"lb": {
|
||||
"all_original_tasks_replaced": true,
|
||||
"mounts_unchanged": true,
|
||||
"before": [
|
||||
"psq3iyz4kraq9u3n2mtkyfijf"
|
||||
],
|
||||
"after": [
|
||||
"oaiciqwjik1afkel0hdgwvhwy"
|
||||
]
|
||||
},
|
||||
"postgres": {
|
||||
"all_original_tasks_replaced": true,
|
||||
"mounts_unchanged": true,
|
||||
"before": [
|
||||
"7xbetpe47jvp1uuu2di2uk7vy"
|
||||
],
|
||||
"after": [
|
||||
"i3scdtmsi49zwytqye6hc3k15"
|
||||
]
|
||||
},
|
||||
"redis": {
|
||||
"all_original_tasks_replaced": true,
|
||||
"mounts_unchanged": true,
|
||||
"before": [
|
||||
"x8ejqk47qyz4rgtgygq48wos7"
|
||||
],
|
||||
"after": [
|
||||
"tqq4m5ygv0nohjefvbdprapzz"
|
||||
]
|
||||
},
|
||||
"minio": {
|
||||
"all_original_tasks_replaced": true,
|
||||
"mounts_unchanged": true,
|
||||
"before": [
|
||||
"ww19llqoe6yjvteqx3by0i4r1"
|
||||
],
|
||||
"after": [
|
||||
"lfmr13mco26ik0a37xk2ntene"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
.venv/bin/python tests/own/swarm_grade4.py
|
||||
PASS: shared-key race on two replicas; replay/conflict/scope/validation/access/logout
|
||||
{"action": "stop-one", "target": "rz3qizaxp0s2bguzbs57me0op", "duration_seconds": 15.458, "successful_writes": 1078, "failed_attempts": 7, "successful_rps": 69.739, "first_recovery_seconds": 1.349, "max_success_gap_seconds": 1.055, "instances_before": ["rz3qizaxp0s2bguzbs57me0op", "xcgz2hubz1xrzmrkoyrgwq0tq"], "instances_after": ["j7awgfnedlt9ne1esywrappxx", "xcgz2hubz1xrzmrkoyrgwq0tq"], "confirmed_messages_checked": 1229, "duplicate_bodies": 0}
|
||||
{"action": "stop-one", "target": "xcgz2hubz1xrzmrkoyrgwq0tq", "duration_seconds": 15.467, "successful_writes": 1091, "failed_attempts": 7, "successful_rps": 70.537, "first_recovery_seconds": 1.384, "max_success_gap_seconds": 1.057, "instances_before": ["j7awgfnedlt9ne1esywrappxx", "xcgz2hubz1xrzmrkoyrgwq0tq"], "instances_after": ["5vy560hk6k0q3eicqodd9dp2z", "j7awgfnedlt9ne1esywrappxx"], "confirmed_messages_checked": 1251, "duplicate_bodies": 0}
|
||||
{"action": "update", "target": null, "duration_seconds": 44.156, "successful_writes": 3362, "failed_attempts": 0, "successful_rps": 76.139, "first_recovery_seconds": null, "max_success_gap_seconds": 0.152, "instances_before": ["5vy560hk6k0q3eicqodd9dp2z", "j7awgfnedlt9ne1esywrappxx"], "instances_after": ["j201rqxerkxdq0vbcw3armc3m", "uqyjmps3u9fyl976lpj944pc5"], "confirmed_messages_checked": 3519, "duplicate_bodies": 0}
|
||||
PASS: each original replica stopped and replaced; rolling update under load; confirmations and sessions preserved
|
||||
@@ -0,0 +1,2 @@
|
||||
.venv/bin/python tests/smoke.py --base-url "http://localhost:8080"
|
||||
PASS: lab4 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,146 @@
|
||||
{
|
||||
"stack": "mtusi-lab4",
|
||||
"docker": "29.5.2",
|
||||
"services": {
|
||||
"lb": {
|
||||
"image": "haproxy:3.2.6-alpine",
|
||||
"limits": {
|
||||
"NanoCPUs": 500000000,
|
||||
"MemoryBytes": 134217728
|
||||
},
|
||||
"published_ports": [
|
||||
{
|
||||
"Protocol": "tcp",
|
||||
"TargetPort": 8080,
|
||||
"PublishedPort": 8080,
|
||||
"PublishMode": "host"
|
||||
}
|
||||
],
|
||||
"secret_names": [],
|
||||
"mounts": [],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "oaiciqwjik1afkel0hdgwvhwy",
|
||||
"state": "running",
|
||||
"container": "ace6b5a9ab2ac3a291bca557e7eb89ba6354ed586625332b99dc3d1cdfaab6b5"
|
||||
}
|
||||
]
|
||||
},
|
||||
"api": {
|
||||
"image": "mtusi-messenger:lab4",
|
||||
"limits": {
|
||||
"NanoCPUs": 1000000000,
|
||||
"MemoryBytes": 1610612736
|
||||
},
|
||||
"published_ports": [],
|
||||
"secret_names": [
|
||||
"mtusi-lab4_cursor_key",
|
||||
"mtusi-lab4_postgres_password",
|
||||
"mtusi-lab4_s3_access_key",
|
||||
"mtusi-lab4_s3_secret_key"
|
||||
],
|
||||
"mounts": [],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "g2s34c3zuztbxehcxyypsyrxy",
|
||||
"state": "running",
|
||||
"container": "303dc53972fde0fe71990f644cb1b56658441a4d1cb6410ffc351ccceb0cd3a7"
|
||||
},
|
||||
{
|
||||
"id": "rz3qizaxp0s2bguzbs57me0op",
|
||||
"state": "running",
|
||||
"container": "f69bf37c2237e13f08bf4aa397936d4fed84a17395410f0af469b2cbc3e41699"
|
||||
}
|
||||
]
|
||||
},
|
||||
"postgres": {
|
||||
"image": "postgres:17.6-alpine3.22",
|
||||
"limits": {
|
||||
"NanoCPUs": 1000000000,
|
||||
"MemoryBytes": 536870912
|
||||
},
|
||||
"published_ports": [],
|
||||
"secret_names": [
|
||||
"mtusi-lab4_postgres_password"
|
||||
],
|
||||
"mounts": [
|
||||
{
|
||||
"Type": "volume",
|
||||
"Source": "mtusi-lab4_postgres_data",
|
||||
"Target": "/var/lib/postgresql/data",
|
||||
"VolumeOptions": {
|
||||
"Labels": {
|
||||
"com.docker.stack.namespace": "mtusi-lab4"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "i3scdtmsi49zwytqye6hc3k15",
|
||||
"state": "running",
|
||||
"container": "1622ddce8784f7dc1092ba808f05583898e08ba57a5c390d227265e4243744dc"
|
||||
}
|
||||
]
|
||||
},
|
||||
"redis": {
|
||||
"image": "redis:7.4.5-alpine3.21",
|
||||
"limits": {
|
||||
"NanoCPUs": 500000000,
|
||||
"MemoryBytes": 134217728
|
||||
},
|
||||
"published_ports": [],
|
||||
"secret_names": [],
|
||||
"mounts": [
|
||||
{
|
||||
"Type": "volume",
|
||||
"Source": "mtusi-lab4_redis_data",
|
||||
"Target": "/data",
|
||||
"VolumeOptions": {
|
||||
"Labels": {
|
||||
"com.docker.stack.namespace": "mtusi-lab4"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "tqq4m5ygv0nohjefvbdprapzz",
|
||||
"state": "running",
|
||||
"container": "dfe7c35a3887061560c608484e33ce1036222d8f683a5729599fb0a4e33065f3"
|
||||
}
|
||||
]
|
||||
},
|
||||
"minio": {
|
||||
"image": "mtusi-minio:RELEASE.2025-09-07T16-13-09Z",
|
||||
"limits": {
|
||||
"NanoCPUs": 1000000000,
|
||||
"MemoryBytes": 536870912
|
||||
},
|
||||
"published_ports": [],
|
||||
"secret_names": [
|
||||
"mtusi-lab4_s3_root_access_key",
|
||||
"mtusi-lab4_s3_root_secret_key"
|
||||
],
|
||||
"mounts": [
|
||||
{
|
||||
"Type": "volume",
|
||||
"Source": "mtusi-lab4_s3_data",
|
||||
"Target": "/data",
|
||||
"VolumeOptions": {
|
||||
"Labels": {
|
||||
"com.docker.stack.namespace": "mtusi-lab4"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "lfmr13mco26ik0a37xk2ntene",
|
||||
"state": "running",
|
||||
"container": "8110ff5d0c7a776005653182ecfd927fe59a8b38b02b4645e1bd03fa1c6fdeff"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
{
|
||||
"stack": "mtusi-lab4",
|
||||
"docker": "29.5.2",
|
||||
"services": {
|
||||
"lb": {
|
||||
"image": "haproxy:3.2.6-alpine",
|
||||
"limits": {
|
||||
"NanoCPUs": 500000000,
|
||||
"MemoryBytes": 134217728
|
||||
},
|
||||
"published_ports": [
|
||||
{
|
||||
"Protocol": "tcp",
|
||||
"TargetPort": 8080,
|
||||
"PublishedPort": 8080,
|
||||
"PublishMode": "host"
|
||||
}
|
||||
],
|
||||
"secret_names": [],
|
||||
"mounts": [],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "psq3iyz4kraq9u3n2mtkyfijf",
|
||||
"state": "running",
|
||||
"container": "c9246107dbeb5aa78d3574865ddb2e9ac2d117c87830ca7be5214bdc8e8768b4"
|
||||
}
|
||||
]
|
||||
},
|
||||
"api": {
|
||||
"image": "mtusi-messenger:lab4",
|
||||
"limits": {
|
||||
"NanoCPUs": 1000000000,
|
||||
"MemoryBytes": 1610612736
|
||||
},
|
||||
"published_ports": [],
|
||||
"secret_names": [
|
||||
"mtusi-lab4_cursor_key",
|
||||
"mtusi-lab4_postgres_password",
|
||||
"mtusi-lab4_s3_access_key",
|
||||
"mtusi-lab4_s3_secret_key"
|
||||
],
|
||||
"mounts": [],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "05qp70hqicx1m3uten0t88c9p",
|
||||
"state": "running",
|
||||
"container": "0beaa8438aa0f61c069729d0d3e83220df07e49288451658d3c92f698c1b7fbc"
|
||||
},
|
||||
{
|
||||
"id": "1diq18xi0jmwpzqzhhq39hjad",
|
||||
"state": "running",
|
||||
"container": "bc1d5078efd2145c84e341ae457360f490f32539d7e4f6d5155378c918da69c8"
|
||||
}
|
||||
]
|
||||
},
|
||||
"postgres": {
|
||||
"image": "postgres:17.6-alpine3.22",
|
||||
"limits": {
|
||||
"NanoCPUs": 1000000000,
|
||||
"MemoryBytes": 536870912
|
||||
},
|
||||
"published_ports": [],
|
||||
"secret_names": [
|
||||
"mtusi-lab4_postgres_password"
|
||||
],
|
||||
"mounts": [
|
||||
{
|
||||
"Type": "volume",
|
||||
"Source": "mtusi-lab4_postgres_data",
|
||||
"Target": "/var/lib/postgresql/data",
|
||||
"VolumeOptions": {
|
||||
"Labels": {
|
||||
"com.docker.stack.namespace": "mtusi-lab4"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "7xbetpe47jvp1uuu2di2uk7vy",
|
||||
"state": "running",
|
||||
"container": "7a24978349b4630091ba38d365fcd74b20c60bd9a27fc15d5cb967e3874e09de"
|
||||
}
|
||||
]
|
||||
},
|
||||
"redis": {
|
||||
"image": "redis:7.4.5-alpine3.21",
|
||||
"limits": {
|
||||
"NanoCPUs": 500000000,
|
||||
"MemoryBytes": 134217728
|
||||
},
|
||||
"published_ports": [],
|
||||
"secret_names": [],
|
||||
"mounts": [
|
||||
{
|
||||
"Type": "volume",
|
||||
"Source": "mtusi-lab4_redis_data",
|
||||
"Target": "/data",
|
||||
"VolumeOptions": {
|
||||
"Labels": {
|
||||
"com.docker.stack.namespace": "mtusi-lab4"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "x8ejqk47qyz4rgtgygq48wos7",
|
||||
"state": "running",
|
||||
"container": "33a57e377891ce0c82807b12757cf0103ef9461502d1a64efdeec506744d9c27"
|
||||
}
|
||||
]
|
||||
},
|
||||
"minio": {
|
||||
"image": "mtusi-minio:RELEASE.2025-09-07T16-13-09Z",
|
||||
"limits": {
|
||||
"NanoCPUs": 1000000000,
|
||||
"MemoryBytes": 536870912
|
||||
},
|
||||
"published_ports": [],
|
||||
"secret_names": [
|
||||
"mtusi-lab4_s3_root_access_key",
|
||||
"mtusi-lab4_s3_root_secret_key"
|
||||
],
|
||||
"mounts": [
|
||||
{
|
||||
"Type": "volume",
|
||||
"Source": "mtusi-lab4_s3_data",
|
||||
"Target": "/data",
|
||||
"VolumeOptions": {
|
||||
"Labels": {
|
||||
"com.docker.stack.namespace": "mtusi-lab4"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "ww19llqoe6yjvteqx3by0i4r1",
|
||||
"state": "running",
|
||||
"container": "d71ce1a062fe9ba9060f5266a9f00d89a34583f133a609769bb2510deaa52470"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
{
|
||||
"stack": "mtusi-lab4",
|
||||
"docker": "29.5.2",
|
||||
"services": {
|
||||
"lb": {
|
||||
"image": "haproxy:3.2.6-alpine",
|
||||
"limits": {
|
||||
"NanoCPUs": 500000000,
|
||||
"MemoryBytes": 134217728
|
||||
},
|
||||
"published_ports": [
|
||||
{
|
||||
"Protocol": "tcp",
|
||||
"TargetPort": 8080,
|
||||
"PublishedPort": 8080,
|
||||
"PublishMode": "host"
|
||||
}
|
||||
],
|
||||
"secret_names": [],
|
||||
"mounts": [],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "oaiciqwjik1afkel0hdgwvhwy",
|
||||
"state": "running",
|
||||
"container": "ace6b5a9ab2ac3a291bca557e7eb89ba6354ed586625332b99dc3d1cdfaab6b5"
|
||||
}
|
||||
]
|
||||
},
|
||||
"api": {
|
||||
"image": "mtusi-messenger:lab4",
|
||||
"limits": {
|
||||
"NanoCPUs": 1000000000,
|
||||
"MemoryBytes": 1610612736
|
||||
},
|
||||
"published_ports": [],
|
||||
"secret_names": [
|
||||
"mtusi-lab4_cursor_key",
|
||||
"mtusi-lab4_postgres_password",
|
||||
"mtusi-lab4_s3_access_key",
|
||||
"mtusi-lab4_s3_secret_key"
|
||||
],
|
||||
"mounts": [],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "uqyjmps3u9fyl976lpj944pc5",
|
||||
"state": "running",
|
||||
"container": "2f98c5810a5f8557476af364186cb66e02c46003fece8827e200313d27f2fd74"
|
||||
},
|
||||
{
|
||||
"id": "j201rqxerkxdq0vbcw3armc3m",
|
||||
"state": "running",
|
||||
"container": "68730a58baf57c19b9919e752e34b7ad247ff29d94918f28fb7ede200c1a95f1"
|
||||
}
|
||||
]
|
||||
},
|
||||
"postgres": {
|
||||
"image": "postgres:17.6-alpine3.22",
|
||||
"limits": {
|
||||
"NanoCPUs": 1000000000,
|
||||
"MemoryBytes": 536870912
|
||||
},
|
||||
"published_ports": [],
|
||||
"secret_names": [
|
||||
"mtusi-lab4_postgres_password"
|
||||
],
|
||||
"mounts": [
|
||||
{
|
||||
"Type": "volume",
|
||||
"Source": "mtusi-lab4_postgres_data",
|
||||
"Target": "/var/lib/postgresql/data",
|
||||
"VolumeOptions": {
|
||||
"Labels": {
|
||||
"com.docker.stack.namespace": "mtusi-lab4"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "i3scdtmsi49zwytqye6hc3k15",
|
||||
"state": "running",
|
||||
"container": "1622ddce8784f7dc1092ba808f05583898e08ba57a5c390d227265e4243744dc"
|
||||
}
|
||||
]
|
||||
},
|
||||
"redis": {
|
||||
"image": "redis:7.4.5-alpine3.21",
|
||||
"limits": {
|
||||
"NanoCPUs": 500000000,
|
||||
"MemoryBytes": 134217728
|
||||
},
|
||||
"published_ports": [],
|
||||
"secret_names": [],
|
||||
"mounts": [
|
||||
{
|
||||
"Type": "volume",
|
||||
"Source": "mtusi-lab4_redis_data",
|
||||
"Target": "/data",
|
||||
"VolumeOptions": {
|
||||
"Labels": {
|
||||
"com.docker.stack.namespace": "mtusi-lab4"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "tqq4m5ygv0nohjefvbdprapzz",
|
||||
"state": "running",
|
||||
"container": "dfe7c35a3887061560c608484e33ce1036222d8f683a5729599fb0a4e33065f3"
|
||||
}
|
||||
]
|
||||
},
|
||||
"minio": {
|
||||
"image": "mtusi-minio:RELEASE.2025-09-07T16-13-09Z",
|
||||
"limits": {
|
||||
"NanoCPUs": 1000000000,
|
||||
"MemoryBytes": 536870912
|
||||
},
|
||||
"published_ports": [],
|
||||
"secret_names": [
|
||||
"mtusi-lab4_s3_root_access_key",
|
||||
"mtusi-lab4_s3_root_secret_key"
|
||||
],
|
||||
"mounts": [
|
||||
{
|
||||
"Type": "volume",
|
||||
"Source": "mtusi-lab4_s3_data",
|
||||
"Target": "/data",
|
||||
"VolumeOptions": {
|
||||
"Labels": {
|
||||
"com.docker.stack.namespace": "mtusi-lab4"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "lfmr13mco26ik0a37xk2ntene",
|
||||
"state": "running",
|
||||
"container": "8110ff5d0c7a776005653182ecfd927fe59a8b38b02b4645e1bd03fa1c6fdeff"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
{
|
||||
"stack": "mtusi-lab4",
|
||||
"docker": "29.5.2",
|
||||
"services": {
|
||||
"lb": {
|
||||
"image": "haproxy:3.2.6-alpine",
|
||||
"limits": {
|
||||
"NanoCPUs": 500000000,
|
||||
"MemoryBytes": 134217728
|
||||
},
|
||||
"published_ports": [
|
||||
{
|
||||
"Protocol": "tcp",
|
||||
"TargetPort": 8080,
|
||||
"PublishedPort": 8080,
|
||||
"PublishMode": "host"
|
||||
}
|
||||
],
|
||||
"secret_names": [],
|
||||
"mounts": [],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "psq3iyz4kraq9u3n2mtkyfijf",
|
||||
"state": "running",
|
||||
"container": "c9246107dbeb5aa78d3574865ddb2e9ac2d117c87830ca7be5214bdc8e8768b4"
|
||||
}
|
||||
]
|
||||
},
|
||||
"api": {
|
||||
"image": "mtusi-messenger:lab4",
|
||||
"limits": {
|
||||
"NanoCPUs": 1000000000,
|
||||
"MemoryBytes": 1610612736
|
||||
},
|
||||
"published_ports": [],
|
||||
"secret_names": [
|
||||
"mtusi-lab4_cursor_key",
|
||||
"mtusi-lab4_postgres_password",
|
||||
"mtusi-lab4_s3_access_key",
|
||||
"mtusi-lab4_s3_secret_key"
|
||||
],
|
||||
"mounts": [],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "0gwv6ha33wg3dao0mqxl9gu0n",
|
||||
"state": "running",
|
||||
"container": "f37c59b0556d4bc5b3f5c0432e8c58da4888ca5286635954131ea37c0714ead1"
|
||||
},
|
||||
{
|
||||
"id": "rbtm0mbmnbzr2oqcz8icho3qr",
|
||||
"state": "running",
|
||||
"container": "17d5f64c6fdd70ac3cdc27e655308909d4670ca0a7b743384ac7fe34e172d428"
|
||||
}
|
||||
]
|
||||
},
|
||||
"postgres": {
|
||||
"image": "postgres:17.6-alpine3.22",
|
||||
"limits": {
|
||||
"NanoCPUs": 1000000000,
|
||||
"MemoryBytes": 536870912
|
||||
},
|
||||
"published_ports": [],
|
||||
"secret_names": [
|
||||
"mtusi-lab4_postgres_password"
|
||||
],
|
||||
"mounts": [
|
||||
{
|
||||
"Type": "volume",
|
||||
"Source": "mtusi-lab4_postgres_data",
|
||||
"Target": "/var/lib/postgresql/data",
|
||||
"VolumeOptions": {
|
||||
"Labels": {
|
||||
"com.docker.stack.namespace": "mtusi-lab4"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "uy9m8wn36msy9qzttodwobkez",
|
||||
"state": "running",
|
||||
"container": "41c7c4bb6a37b443982f168a8e8494847581c2e30d1d6f5bf817284aebaf96b9"
|
||||
}
|
||||
]
|
||||
},
|
||||
"redis": {
|
||||
"image": "redis:7.4.5-alpine3.21",
|
||||
"limits": {
|
||||
"NanoCPUs": 500000000,
|
||||
"MemoryBytes": 134217728
|
||||
},
|
||||
"published_ports": [],
|
||||
"secret_names": [],
|
||||
"mounts": [
|
||||
{
|
||||
"Type": "volume",
|
||||
"Source": "mtusi-lab4_redis_data",
|
||||
"Target": "/data",
|
||||
"VolumeOptions": {
|
||||
"Labels": {
|
||||
"com.docker.stack.namespace": "mtusi-lab4"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "x8ejqk47qyz4rgtgygq48wos7",
|
||||
"state": "running",
|
||||
"container": "33a57e377891ce0c82807b12757cf0103ef9461502d1a64efdeec506744d9c27"
|
||||
}
|
||||
]
|
||||
},
|
||||
"minio": {
|
||||
"image": "mtusi-minio:RELEASE.2025-09-07T16-13-09Z",
|
||||
"limits": {
|
||||
"NanoCPUs": 1000000000,
|
||||
"MemoryBytes": 536870912
|
||||
},
|
||||
"published_ports": [],
|
||||
"secret_names": [
|
||||
"mtusi-lab4_s3_root_access_key",
|
||||
"mtusi-lab4_s3_root_secret_key"
|
||||
],
|
||||
"mounts": [
|
||||
{
|
||||
"Type": "volume",
|
||||
"Source": "mtusi-lab4_s3_data",
|
||||
"Target": "/data",
|
||||
"VolumeOptions": {
|
||||
"Labels": {
|
||||
"com.docker.stack.namespace": "mtusi-lab4"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"tasks": [
|
||||
{
|
||||
"id": "jafk96quou17emokdyfk1qi4t",
|
||||
"state": "running",
|
||||
"container": "a04bf799191faea4386533680968586c90d67adeef8f37166824aa4723f8ac03"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
.venv/bin/python scripts/swarm.py update
|
||||
mtusi-lab4_api
|
||||
PASS: rolling update completed
|
||||
@@ -0,0 +1,105 @@
|
||||
{
|
||||
"concurrency": 10,
|
||||
"warmup_uploads": 1,
|
||||
"memory_method": "cgroup v2 memory.current sampled every >=100ms; values include file cache",
|
||||
"runs": [
|
||||
{
|
||||
"width": 512,
|
||||
"height": 512,
|
||||
"size_bytes": 787252,
|
||||
"sha256": "1a09c45b4a706ff8009c1adf0e9f10e428d8059d335e074cf4ad456680d4b473",
|
||||
"requests": 10,
|
||||
"successful": 10,
|
||||
"errors": 0,
|
||||
"duration_seconds": 0.325,
|
||||
"successful_rps": 30.816,
|
||||
"latency_ms": {
|
||||
"0.5": 120.287,
|
||||
"0.95": 172.127,
|
||||
"0.99": 172.127
|
||||
},
|
||||
"baseline_bytes": {
|
||||
"a43c3f7e6e92": 45240320,
|
||||
"007b52fbba64": 45174784
|
||||
},
|
||||
"sampled_peak_bytes": {
|
||||
"a43c3f7e6e92": 47005696,
|
||||
"007b52fbba64": 46907392
|
||||
},
|
||||
"kernel_lifetime_peak_before_bytes": {
|
||||
"a43c3f7e6e92": 46804992,
|
||||
"007b52fbba64": 46718976
|
||||
},
|
||||
"kernel_lifetime_peak_after_bytes": {
|
||||
"a43c3f7e6e92": 48623616,
|
||||
"007b52fbba64": 48693248
|
||||
},
|
||||
"sampled_peak_sum_bytes": 93913088,
|
||||
"samples": [
|
||||
{
|
||||
"seconds": 0.045,
|
||||
"bytes": {
|
||||
"a43c3f7e6e92": 47005696,
|
||||
"007b52fbba64": 46907392
|
||||
}
|
||||
},
|
||||
{
|
||||
"seconds": 0.325,
|
||||
"bytes": {
|
||||
"a43c3f7e6e92": 46116864,
|
||||
"007b52fbba64": 46080000
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"width": 1024,
|
||||
"height": 768,
|
||||
"size_bytes": 2360847,
|
||||
"sha256": "ad94bc1d209135dea4d3caa0712cee92cfaa97ba3ccdd5797aff6664fcce4a2a",
|
||||
"requests": 10,
|
||||
"successful": 10,
|
||||
"errors": 0,
|
||||
"duration_seconds": 0.401,
|
||||
"successful_rps": 24.957,
|
||||
"latency_ms": {
|
||||
"0.5": 258.573,
|
||||
"0.95": 324.694,
|
||||
"0.99": 324.694
|
||||
},
|
||||
"baseline_bytes": {
|
||||
"a43c3f7e6e92": 46067712,
|
||||
"007b52fbba64": 46063616
|
||||
},
|
||||
"sampled_peak_bytes": {
|
||||
"a43c3f7e6e92": 41107456,
|
||||
"007b52fbba64": 13651968
|
||||
},
|
||||
"kernel_lifetime_peak_before_bytes": {
|
||||
"a43c3f7e6e92": 48623616,
|
||||
"007b52fbba64": 48693248
|
||||
},
|
||||
"kernel_lifetime_peak_after_bytes": {
|
||||
"a43c3f7e6e92": 49119232,
|
||||
"007b52fbba64": 49922048
|
||||
},
|
||||
"sampled_peak_sum_bytes": 54759424,
|
||||
"samples": [
|
||||
{
|
||||
"seconds": 0.043,
|
||||
"bytes": {
|
||||
"a43c3f7e6e92": 41107456,
|
||||
"007b52fbba64": 13651968
|
||||
}
|
||||
},
|
||||
{
|
||||
"seconds": 0.401,
|
||||
"bytes": {
|
||||
"a43c3f7e6e92": 13234176,
|
||||
"007b52fbba64": 10956800
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
.venv/bin/python scripts/measure_uploads.py
|
||||
{"width": 512, "height": 512, "size_bytes": 787252, "sha256": "1a09c45b4a706ff8009c1adf0e9f10e428d8059d335e074cf4ad456680d4b473", "requests": 10, "successful": 10, "errors": 0, "duration_seconds": 0.325, "successful_rps": 30.816, "latency_ms": {"0.5": 120.287, "0.95": 172.127, "0.99": 172.127}, "baseline_bytes": {"a43c3f7e6e92": 45240320, "007b52fbba64": 45174784}, "sampled_peak_bytes": {"a43c3f7e6e92": 47005696, "007b52fbba64": 46907392}, "kernel_lifetime_peak_before_bytes": {"a43c3f7e6e92": 46804992, "007b52fbba64": 46718976}, "kernel_lifetime_peak_after_bytes": {"a43c3f7e6e92": 48623616, "007b52fbba64": 48693248}, "sampled_peak_sum_bytes": 93913088}
|
||||
{"width": 1024, "height": 768, "size_bytes": 2360847, "sha256": "ad94bc1d209135dea4d3caa0712cee92cfaa97ba3ccdd5797aff6664fcce4a2a", "requests": 10, "successful": 10, "errors": 0, "duration_seconds": 0.401, "successful_rps": 24.957, "latency_ms": {"0.5": 258.573, "0.95": 324.694, "0.99": 324.694}, "baseline_bytes": {"a43c3f7e6e92": 46067712, "007b52fbba64": 46063616}, "sampled_peak_bytes": {"a43c3f7e6e92": 41107456, "007b52fbba64": 13651968}, "kernel_lifetime_peak_before_bytes": {"a43c3f7e6e92": 48623616, "007b52fbba64": 48693248}, "kernel_lifetime_peak_after_bytes": {"a43c3f7e6e92": 49119232, "007b52fbba64": 49922048}, "sampled_peak_sum_bytes": 54759424}
|
||||
PASS: ten simultaneous uploads at two sizes; all originals verified; memory samples saved.
|
||||
@@ -0,0 +1,8 @@
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
.venv/bin/python scripts/validate_openapi.py
|
||||
/Users/dkhakimovig/mtusi2026lab4/.venv/lib/python3.9/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
|
||||
warnings.warn(
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
PASS: goose3.27.1 migration syntax validated.
|
||||
PASS: mandatory lab4 contract and public checks unchanged.
|
||||
@@ -0,0 +1,176 @@
|
||||
.venv/bin/python scripts/swarm.py up
|
||||
vphhh79vd5ti8501q6m9lzulj
|
||||
Local secrets are ready.
|
||||
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
|
||||
Install the buildx component to build images with BuildKit:
|
||||
https://docs.docker.com/go/buildx/
|
||||
|
||||
Sending build context to Docker daemon 461.3kB␍
|
||||
Step 1/39 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS goose-builder
|
||||
---> 18b460dd1754
|
||||
Step 2/39 : RUN GOMAXPROCS=2 GOFLAGS=-p=1 GOBIN=/out CGO_ENABLED=0 go install -tags='no_clickhouse no_libsql no_mssql no_mysql no_sqlite3 no_vertica no_ydb no_spanner' github.com/pressly/goose/v3/cmd/goose@v3.27.1
|
||||
---> Using cache
|
||||
---> 15f4b2e3468a
|
||||
Step 3/39 : FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616 AS migrations
|
||||
---> 075c2c1a4068
|
||||
Step 4/39 : COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
---> Using cache
|
||||
---> 6a0ad52336c1
|
||||
Step 5/39 : COPY migrations /migrations
|
||||
---> Using cache
|
||||
---> 01a2e64cbb7d
|
||||
Step 6/39 : COPY infra/migrate.sh /usr/local/bin/migrate
|
||||
---> Using cache
|
||||
---> 7382e24476ff
|
||||
Step 7/39 : USER 10001:10001
|
||||
---> Using cache
|
||||
---> 6c54ddff6a36
|
||||
Step 8/39 : ENTRYPOINT ["/usr/local/bin/migrate"]
|
||||
---> Using cache
|
||||
---> 7e8134892cf2
|
||||
Step 9/39 : CMD ["up"]
|
||||
---> Using cache
|
||||
---> adb6e8d9b58a
|
||||
Step 10/39 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS builder
|
||||
---> 18b460dd1754
|
||||
Step 11/39 : WORKDIR /src
|
||||
---> Using cache
|
||||
---> 1ba013278a4a
|
||||
Step 12/39 : RUN apk add --no-cache gcc musl-dev
|
||||
---> Using cache
|
||||
---> a0ea65f0bded
|
||||
Step 13/39 : COPY go.mod go.sum ./
|
||||
---> Using cache
|
||||
---> e98ccecfb093
|
||||
Step 14/39 : RUN go mod download
|
||||
---> Using cache
|
||||
---> 91d546c71507
|
||||
Step 15/39 : COPY cmd ./cmd
|
||||
---> Using cache
|
||||
---> 7d74a0366782
|
||||
Step 16/39 : COPY contracts ./contracts
|
||||
---> Using cache
|
||||
---> 89e9eb49cf2e
|
||||
Step 17/39 : COPY dto ./dto
|
||||
---> Using cache
|
||||
---> b3608ba9d910
|
||||
Step 18/39 : COPY internal ./internal
|
||||
---> Using cache
|
||||
---> 420381f245d1
|
||||
Step 19/39 : COPY migrations ./migrations
|
||||
---> Using cache
|
||||
---> 244708889b45
|
||||
Step 20/39 : ENV GOFLAGS=-p=1 GOMAXPROCS=2
|
||||
---> Using cache
|
||||
---> a86cf22e4c7d
|
||||
Step 21/39 : RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/messenger ./cmd
|
||||
---> Using cache
|
||||
---> e1ea9cbf840a
|
||||
Step 22/39 : RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/reconcile ./cmd/reconcile
|
||||
---> Using cache
|
||||
---> 4669d728553f
|
||||
Step 23/39 : RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/worker ./cmd/worker
|
||||
---> Using cache
|
||||
---> fe51ba375215
|
||||
Step 24/39 : FROM builder AS tests
|
||||
---> fe51ba375215
|
||||
Step 25/39 : COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
---> Using cache
|
||||
---> 3ef73620b0a6
|
||||
Step 26/39 : ENV GOOSE_MIGRATION_DIR=/src/migrations
|
||||
---> Using cache
|
||||
---> 43905e46829a
|
||||
Step 27/39 : CMD ["go", "test", "-p=1", "-race", "-count=1", "-v", "./..."]
|
||||
---> Using cache
|
||||
---> 037b4f43fd3c
|
||||
Step 28/39 : FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616
|
||||
---> 075c2c1a4068
|
||||
Step 29/39 : RUN apk add --no-cache libwebp-tools=1.6.0-r0
|
||||
---> Using cache
|
||||
---> 3a741cc26d52
|
||||
Step 30/39 : RUN addgroup -S messenger && adduser -S -D -H -u 10001 -G messenger messenger
|
||||
---> Using cache
|
||||
---> 444b794708dc
|
||||
Step 31/39 : COPY --from=builder --chown=messenger:messenger /out/messenger /usr/local/bin/messenger
|
||||
---> 32fc6da7172f
|
||||
Step 32/39 : COPY --from=builder --chown=messenger:messenger /out/reconcile /usr/local/bin/reconcile
|
||||
---> 49b1f874a5e0
|
||||
Step 33/39 : COPY --from=builder --chown=messenger:messenger /out/worker /usr/local/bin/worker
|
||||
---> f7ab6619c5c8
|
||||
Step 34/39 : ENV PORT=8080
|
||||
---> Running in 0f8f2d74139c
|
||||
---> Removed intermediate container 0f8f2d74139c
|
||||
---> ab0764165606
|
||||
Step 35/39 : EXPOSE 8080
|
||||
---> Running in 082ca714270a
|
||||
---> Removed intermediate container 082ca714270a
|
||||
---> 9a16ff1522d8
|
||||
Step 36/39 : USER messenger:messenger
|
||||
---> Running in 2fa42c5d86db
|
||||
---> Removed intermediate container 2fa42c5d86db
|
||||
---> 50c7d9a72042
|
||||
Step 37/39 : HEALTHCHECK --interval=10s --timeout=3s --start-period=3s --retries=3 CMD wget -q -O /dev/null "http://127.0.0.1:${PORT}/health/ready" || exit 1
|
||||
---> Running in 8b938c89cf6d
|
||||
---> Removed intermediate container 8b938c89cf6d
|
||||
---> 74607fcd70f9
|
||||
Step 38/39 : STOPSIGNAL SIGTERM
|
||||
---> Running in e747d914802f
|
||||
---> Removed intermediate container e747d914802f
|
||||
---> 95748bec26d8
|
||||
Step 39/39 : ENTRYPOINT ["/usr/local/bin/messenger"]
|
||||
---> Running in b502e1c9cff0
|
||||
---> Removed intermediate container b502e1c9cff0
|
||||
---> 66e3c9bc004e
|
||||
Successfully built 66e3c9bc004e
|
||||
Successfully tagged mtusi-messenger:lab5
|
||||
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
|
||||
Install the buildx component to build images with BuildKit:
|
||||
https://docs.docker.com/go/buildx/
|
||||
|
||||
Sending build context to Docker daemon 461.3kB␍
|
||||
Step 1/9 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS goose-builder
|
||||
---> 18b460dd1754
|
||||
Step 2/9 : RUN GOMAXPROCS=2 GOFLAGS=-p=1 GOBIN=/out CGO_ENABLED=0 go install -tags='no_clickhouse no_libsql no_mssql no_mysql no_sqlite3 no_vertica no_ydb no_spanner' github.com/pressly/goose/v3/cmd/goose@v3.27.1
|
||||
---> Using cache
|
||||
---> 15f4b2e3468a
|
||||
Step 3/9 : FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616 AS migrations
|
||||
---> 075c2c1a4068
|
||||
Step 4/9 : COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
---> Using cache
|
||||
---> 6a0ad52336c1
|
||||
Step 5/9 : COPY migrations /migrations
|
||||
---> Using cache
|
||||
---> 01a2e64cbb7d
|
||||
Step 6/9 : COPY infra/migrate.sh /usr/local/bin/migrate
|
||||
---> Using cache
|
||||
---> 7382e24476ff
|
||||
Step 7/9 : USER 10001:10001
|
||||
---> Using cache
|
||||
---> 6c54ddff6a36
|
||||
Step 8/9 : ENTRYPOINT ["/usr/local/bin/migrate"]
|
||||
---> Using cache
|
||||
---> 7e8134892cf2
|
||||
Step 9/9 : CMD ["up"]
|
||||
---> Using cache
|
||||
---> adb6e8d9b58a
|
||||
Successfully built adb6e8d9b58a
|
||||
Successfully tagged mtusi-migrations:lab5
|
||||
mtusi-lab5_api scaled to 0
|
||||
9mm30n5f5blu6kdfvhvartwr0
|
||||
mtusi-lab5_migrations.0.1hb6hxpeyw5j@colima | 2026/11/10 18:25:49 goose: no migrations to run. current version: 10
|
||||
mtusi-lab5_migrations
|
||||
Since --detach=false was not specified, tasks will be created in the background.
|
||||
In a future release, --detach=false will become the default.
|
||||
Updating service mtusi-lab5_lb (id: tnlj2tzpx91wj066wqi3y5k44)
|
||||
Updating service mtusi-lab5_postgres (id: f4xn3ammg3isejqsm9cqng6yo)
|
||||
Updating service mtusi-lab5_redis (id: kz94wxnzhqwettqixbya643dl)
|
||||
Updating service mtusi-lab5_minio (id: oaf1v50i58o60qnbk5flk0k59)
|
||||
Updating service mtusi-lab5_api (id: oey97yu6vv15p4dn10pptf3b8)
|
||||
Updating service mtusi-lab5_worker (id: lctq7ul45bu47a6vjbvt6xgeo)
|
||||
hs7eigkxh4jah526bbx4nlt0t
|
||||
mtusi-lab5_s3-bootstrap.0.veoz00w0hdfq@colima | PASS: private bucket and restricted API account configured.
|
||||
mtusi-lab5_s3-bootstrap
|
||||
mtusi-lab5_api scaled to 2
|
||||
mtusi-lab5_api
|
||||
PASS: rolling update completed
|
||||
PASS: Swarm stack ready at http://localhost:18085
|
||||
@@ -0,0 +1,4 @@
|
||||
.venv/bin/python tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:18085"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 123, "failed_attempts": 1, "first_recovery_seconds": 0.696}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
@@ -0,0 +1,12 @@
|
||||
.venv/bin/python tests/own/lab5.py
|
||||
Traceback (most recent call last):
|
||||
File "/Users/dkhakimovig/mtusi2026lab5/tests/own/lab5.py", line 302, in <module>
|
||||
main()
|
||||
File "/Users/dkhakimovig/mtusi2026lab5/tests/own/lab5.py", line 156, in main
|
||||
variant_check(c,bob,item,body,shape)
|
||||
File "/Users/dkhakimovig/mtusi2026lab5/tests/own/lab5.py", line 101, in variant_check
|
||||
check((variants['thumbnail']['width'],variants['thumbnail']['height'])==expected_thumb,'thumbnail geometry')
|
||||
File "/Users/dkhakimovig/mtusi2026lab5/tests/client.py", line 24, in check
|
||||
raise Failure(message)
|
||||
client.Failure: thumbnail geometry
|
||||
make: *** [test-lab5] Error 1
|
||||
@@ -0,0 +1,17 @@
|
||||
.venv/bin/python tests/own/lab5.py
|
||||
PASS: input/ACL, three actual formats, geometry, EXIF, alpha
|
||||
PASS: COMMIT/publish gap, queued link, API/broker restarts, worker recovery
|
||||
PASS: crash after objects, expired lease/fencing, same four keys
|
||||
PASS: COMMIT before ack, duplicate no-op and ready replay rejection
|
||||
PASS: bounded retry/backoff, failed registry, safe audited replay
|
||||
Traceback (most recent call last):
|
||||
File "/Users/dkhakimovig/mtusi2026lab5/tests/own/lab5.py", line 310, in <module>
|
||||
main()
|
||||
File "/Users/dkhakimovig/mtusi2026lab5/tests/own/lab5.py", line 277, in main
|
||||
failed=wait_state(item,'failed')
|
||||
File "/Users/dkhakimovig/mtusi2026lab5/tests/own/lab5.py", line 100, in wait_state
|
||||
return until(lambda: job(att), lambda j: j['state']==state, timeout)
|
||||
File "/Users/dkhakimovig/mtusi2026lab5/tests/own/lab5.py", line 39, in until
|
||||
raise AssertionError('condition deadline exceeded; last='+str(last))
|
||||
AssertionError: condition deadline exceeded; last={'id': '4fc5ab5e-3e10-4e78-a6ea-9599d6f941be', 'attachment_id': '7122d895-5b38-480f-8238-8df26958810f', 'pipeline_version': 1, 'state': 'ready', 'attempts': 1, 'max_attempts': 2, 'available_at': '2026-11-10T18:47:28.488754+00:00', 'lease_until': None, 'fence': 1, 'last_error': None, 'created_at': '2026-11-10T18:47:28.33972+00:00', 'updated_at': '2026-11-10T18:47:28.488935+00:00'}
|
||||
make: *** [test-lab5] Error 1
|
||||
@@ -0,0 +1,2 @@
|
||||
PASS: input/ACL, three actual formats, geometry, EXIF, alpha
|
||||
PASS: all lab5 fault, retry, replay, durability, rendering and cleanup checks
|
||||
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"stack": "mtusi-lab5",
|
||||
"cases": {
|
||||
"input_and_acl": [
|
||||
{
|
||||
"name": "oversized",
|
||||
"status": 413
|
||||
},
|
||||
{
|
||||
"name": "damaged",
|
||||
"status": 415
|
||||
},
|
||||
{
|
||||
"name": "pixel_budget",
|
||||
"status": 413
|
||||
},
|
||||
{
|
||||
"name": "mime_spoof",
|
||||
"status": 415
|
||||
},
|
||||
{
|
||||
"name": "filename",
|
||||
"status": 400
|
||||
},
|
||||
{
|
||||
"name": "unsupported",
|
||||
"status": 415
|
||||
}
|
||||
],
|
||||
"small_alpha_exif": "PASS",
|
||||
"private_s3": {
|
||||
"anonymous_get": 403,
|
||||
"outside_prefix_denied": true
|
||||
},
|
||||
"stage_before_commit": {
|
||||
"upload_status": 503,
|
||||
"metadata": 0,
|
||||
"fresh_orphan_preserved": true
|
||||
},
|
||||
"commit_publish_and_restarts": {
|
||||
"job_id": "51f7ee76-3566-4837-a91d-74d5a0afec7b",
|
||||
"api_restart": true,
|
||||
"broker_restarts": 2,
|
||||
"link_queued": true
|
||||
},
|
||||
"crash_after_objects": {
|
||||
"attempts": 2,
|
||||
"objects": 4,
|
||||
"fence": 2
|
||||
},
|
||||
"commit_before_ack_and_duplicate": {
|
||||
"ready_unchanged": true,
|
||||
"ready_replay_rejected": true
|
||||
},
|
||||
"bounded_retry_replay": {
|
||||
"max_attempts": 2,
|
||||
"retry_available_at": "2026-11-10T18:47:14.297456+00:00",
|
||||
"first_backoff_seconds": 2.492,
|
||||
"failed_attempts": 2,
|
||||
"audits": 1
|
||||
},
|
||||
"permanent_stage_error": {
|
||||
"attempts": 1,
|
||||
"error_code": "invalid_image"
|
||||
},
|
||||
"renderer_process_group_timeout": {
|
||||
"deadline_seconds": 2,
|
||||
"elapsed_seconds": 2.27,
|
||||
"cwebp_observed": true,
|
||||
"descendants_after_failure": 0
|
||||
},
|
||||
"staging_cleanup": {
|
||||
"ready_stages_remaining": 0,
|
||||
"linked_original_preserved": true,
|
||||
"failed_retention_days": 7,
|
||||
"expired_failed_stage_removed": true,
|
||||
"expired_replay_rejected": true,
|
||||
"unconfirmed_orphan_removed": true
|
||||
}
|
||||
},
|
||||
"started_at": 1794336125.445686,
|
||||
"resumed_at": [
|
||||
1794336751.851368
|
||||
],
|
||||
"finished_at": 1794336891.683626
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
? gitflic.ru/akselbant/mtusi2026lab1-fork/cmd [no test files]
|
||||
? gitflic.ru/akselbant/mtusi2026lab1-fork/cmd/reconcile [no test files]
|
||||
? gitflic.ru/akselbant/mtusi2026lab1-fork/cmd/worker [no test files]
|
||||
? gitflic.ru/akselbant/mtusi2026lab1-fork/contracts [no test files]
|
||||
ok gitflic.ru/akselbant/mtusi2026lab1-fork/dto (cached)
|
||||
ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/app/chat 14.228s
|
||||
ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/attachment 2.227s
|
||||
? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/config [no test files]
|
||||
? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain [no test files]
|
||||
ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/password (cached)
|
||||
? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/repository [no test files]
|
||||
ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/repository/postgres 1.666s
|
||||
? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/session [no test files]
|
||||
ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/usecase/chat (cached)
|
||||
@@ -0,0 +1,355 @@
|
||||
.venv/bin/python scripts/swarm.py test-integration
|
||||
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
|
||||
Install the buildx component to build images with BuildKit:
|
||||
https://docs.docker.com/go/buildx/
|
||||
|
||||
Sending build context to Docker daemon 460.3kB␍
|
||||
Step 1/27 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS goose-builder
|
||||
---> 18b460dd1754
|
||||
Step 2/27 : RUN GOMAXPROCS=2 GOFLAGS=-p=1 GOBIN=/out CGO_ENABLED=0 go install -tags='no_clickhouse no_libsql no_mssql no_mysql no_sqlite3 no_vertica no_ydb no_spanner' github.com/pressly/goose/v3/cmd/goose@v3.27.1
|
||||
---> Using cache
|
||||
---> 15f4b2e3468a
|
||||
Step 3/27 : FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616 AS migrations
|
||||
---> 075c2c1a4068
|
||||
Step 4/27 : COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
---> Using cache
|
||||
---> 6a0ad52336c1
|
||||
Step 5/27 : COPY migrations /migrations
|
||||
---> Using cache
|
||||
---> 01a2e64cbb7d
|
||||
Step 6/27 : COPY infra/migrate.sh /usr/local/bin/migrate
|
||||
---> Using cache
|
||||
---> 7382e24476ff
|
||||
Step 7/27 : USER 10001:10001
|
||||
---> Using cache
|
||||
---> 6c54ddff6a36
|
||||
Step 8/27 : ENTRYPOINT ["/usr/local/bin/migrate"]
|
||||
---> Using cache
|
||||
---> 7e8134892cf2
|
||||
Step 9/27 : CMD ["up"]
|
||||
---> Using cache
|
||||
---> adb6e8d9b58a
|
||||
Step 10/27 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS builder
|
||||
---> 18b460dd1754
|
||||
Step 11/27 : WORKDIR /src
|
||||
---> Using cache
|
||||
---> 1ba013278a4a
|
||||
Step 12/27 : RUN apk add --no-cache gcc musl-dev
|
||||
---> Using cache
|
||||
---> a0ea65f0bded
|
||||
Step 13/27 : COPY go.mod go.sum ./
|
||||
---> Using cache
|
||||
---> e98ccecfb093
|
||||
Step 14/27 : RUN go mod download
|
||||
---> Using cache
|
||||
---> 91d546c71507
|
||||
Step 15/27 : COPY cmd ./cmd
|
||||
---> Using cache
|
||||
---> 7d74a0366782
|
||||
Step 16/27 : COPY contracts ./contracts
|
||||
---> Using cache
|
||||
---> 89e9eb49cf2e
|
||||
Step 17/27 : COPY dto ./dto
|
||||
---> Using cache
|
||||
---> b3608ba9d910
|
||||
Step 18/27 : COPY internal ./internal
|
||||
---> 44f1a9efcc66
|
||||
Step 19/27 : COPY migrations ./migrations
|
||||
---> acefcd8a83af
|
||||
Step 20/27 : ENV GOFLAGS=-p=1 GOMAXPROCS=2
|
||||
---> Running in 6f0922eb42d3
|
||||
---> Removed intermediate container 6f0922eb42d3
|
||||
---> 2cda01161c62
|
||||
Step 21/27 : RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/messenger ./cmd
|
||||
---> Running in 26952912ceb7
|
||||
---> Removed intermediate container 26952912ceb7
|
||||
---> 889afe1963f8
|
||||
Step 22/27 : RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/reconcile ./cmd/reconcile
|
||||
---> Running in 04665a280741
|
||||
---> Removed intermediate container 04665a280741
|
||||
---> 43cd9030aa04
|
||||
Step 23/27 : RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/worker ./cmd/worker
|
||||
---> Running in 5b0325120af9
|
||||
---> Removed intermediate container 5b0325120af9
|
||||
---> 66906c7f16a8
|
||||
Step 24/27 : FROM builder AS tests
|
||||
---> 66906c7f16a8
|
||||
Step 25/27 : COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
---> 7e67bb289391
|
||||
Step 26/27 : ENV GOOSE_MIGRATION_DIR=/src/migrations
|
||||
---> Running in 1b5b33f07921
|
||||
---> Removed intermediate container 1b5b33f07921
|
||||
---> 3aba3008d340
|
||||
Step 27/27 : CMD ["go", "test", "-p=1", "-race", "-count=1", "-v", "./..."]
|
||||
---> Running in bb4863e04cfd
|
||||
---> Removed intermediate container bb4863e04cfd
|
||||
---> 471b66a42df0
|
||||
Successfully built 471b66a42df0
|
||||
Successfully tagged mtusi-messenger-tests:lab5
|
||||
e5yt4nofpygdupx0vhbijo6dj
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/cmd [no test files]
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/cmd/reconcile [no test files]
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/cmd/worker [no test files]
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/contracts [no test files]
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestMessageStrictFields
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestMessageStrictFields (0.00s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestTimestampFixedMicroseconds
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestTimestampFixedMicroseconds (0.00s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | PASS
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/dto 1.013s
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestRejectsMalformedJSON
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:44 request_id=78adaf84-7aaa-42f4-a084-a2db8cffcf98 method=POST path=/api/v1/users status=400 response_bytes=140 latency=131.98µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestRejectsMalformedJSON (0.00s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestHidesForeignChat
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:45 request_id=1bf6ff0c-9371-4b01-9941-77e94d023b10 method=POST path=/api/v1/users status=201 response_bytes=141 latency=365.251444ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:45 request_id=f50eb79b-cca7-4993-8191-8734738e9c40 method=POST path=/api/v1/auth/sessions status=201 response_bytes=269 latency=398.873152ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:45 request_id=5a967846-e8a8-449a-a09d-c8d365025b46 method=POST path=/api/v1/users status=201 response_bytes=147 latency=381.399429ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:46 request_id=714a25ea-10d1-4b85-8c24-ec4d371bb7b6 method=POST path=/api/v1/auth/sessions status=201 response_bytes=275 latency=422.991476ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:46 request_id=2345f91f-0c23-45d3-a491-8dfd5556d174 method=POST path=/api/v1/chats status=201 response_bytes=163 latency=188.281µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:46 request_id=0336f4ad-d624-4ecf-9cdf-51301294d0e8 method=GET path=/api/v1/chats/:chat_id status=404 response_bytes=126 latency=284.797µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestHidesForeignChat (1.57s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestRejectsEmptyMessage
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:46 request_id=44c2744c-4cd0-4c7e-992d-a4dfb0b061b6 method=POST path=/api/v1/users status=201 response_bytes=157 latency=368.07845ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:47 request_id=af848f3f-b52b-4af3-85f8-bd965300d1ee method=POST path=/api/v1/auth/sessions status=201 response_bytes=285 latency=366.256457ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:47 request_id=23df23c7-578f-4c76-a10b-104f2426b9cd method=POST path=/api/v1/chats status=201 response_bytes=163 latency=133.647µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:47 request_id=b90bf297-9272-4bfb-a83f-47b326cb5ce1 method=POST path=/api/v1/chats/:chat_id/messages status=400 response_bytes=172 latency=152.233µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestRejectsEmptyMessage (0.74s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestRejectsDuplicateUsername
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:47 request_id=178aa11a-597f-493f-b227-c667f089540b method=POST path=/api/v1/users status=201 response_bytes=149 latency=351.691662ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:47 request_id=2f3ba9cf-b14c-4ae9-adfd-ec9f3028a50e method=POST path=/api/v1/auth/sessions status=201 response_bytes=277 latency=367.085423ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:48 request_id=0a727f2e-dc6b-4c93-8639-de50d77626b5 method=POST path=/api/v1/users status=409 response_bytes=170 latency=359.315715ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestRejectsDuplicateUsername (1.08s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestPaginatesMessagesAcrossMultiplePages
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:48 request_id=b3142e33-707a-46f5-b178-35509037b4cc method=POST path=/api/v1/users status=201 response_bytes=151 latency=409.355414ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:48 request_id=448e921b-0b3a-434c-8961-b6aa51530d88 method=POST path=/api/v1/auth/sessions status=201 response_bytes=279 latency=387.814711ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:48 request_id=8cf5775f-be80-476a-8f65-1fae6ba4d114 method=POST path=/api/v1/chats status=201 response_bytes=163 latency=162.61µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:48 request_id=9e3a4eaf-e3f0-4c1c-88a7-651b43fde65c method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=266.503µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:48 request_id=57d23cd6-2482-4656-8621-670b43ef8d3d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=186.906µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:48 request_id=92183f25-6ab2-4c74-a970-9cf52a20d989 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=167.945µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:48 request_id=8da17cdd-9817-47dd-89e5-156bf0009a30 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=167.528µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:48 request_id=364216f6-407d-4f49-97ac-1d79491067b4 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=176.779µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:48 request_id=7abdd979-4157-4d85-bdb7-41b31fdb5612 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=130.438µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:48 request_id=30e71f25-5fcc-47fa-9349-eaa52423b428 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=134.814µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:48 request_id=17a01d04-e615-4d86-8016-fbf560e6f1e6 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=725 latency=380.521µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:48 request_id=f9ebd8b6-f40a-49b9-8c46-03524ae60c7e method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=725 latency=183.197µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:48 request_id=ec02dec4-7e4c-4fdd-b05e-0115f5485111 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=725 latency=174.862µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:48 request_id=90cae6ae-fe4e-4e2a-8765-2ad81c9abaf1 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=259 latency=114.519µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestPaginatesMessagesAcrossMultiplePages (0.81s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestConcurrentMessagesAreUnique
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:49 request_id=0430c49b-26f0-4036-b772-e6267ecd0b14 method=POST path=/api/v1/users status=201 response_bytes=153 latency=370.09502ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:49 request_id=7f5a51e7-7002-4917-84b0-dc9725be54a9 method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=360.387497ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:50 request_id=a349814a-0888-445e-9726-a33a6712c43c method=POST path=/api/v1/users status=201 response_bytes=153 latency=360.66339ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:50 request_id=fb3e86ae-a739-4e7d-bc78-559fadbbf787 method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=394.640836ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:50 request_id=0fc70956-e867-4377-96e5-329dda30cd31 method=POST path=/api/v1/users status=201 response_bytes=153 latency=367.006565ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:51 request_id=0f9813dc-7c0d-4163-9793-882e84468d33 method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=353.933555ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:51 request_id=4440bfa8-9d31-4297-9343-80ded2259f6a method=POST path=/api/v1/users status=201 response_bytes=153 latency=375.799206ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:51 request_id=56c0bfa7-4938-47a5-ac31-543cddca96e9 method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=366.48411ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:52 request_id=36983337-938e-4c9f-868a-7cc2f1525f5e method=POST path=/api/v1/users status=201 response_bytes=153 latency=373.712012ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:52 request_id=a2853b02-5099-4cbd-aa6c-cbfb617a289d method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=505.163831ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:53 request_id=2170619b-d50a-41a7-a77f-d38fa3fe45a2 method=POST path=/api/v1/users status=201 response_bytes=153 latency=379.44649ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:53 request_id=7fccfc33-4433-459d-929d-c59c71d7d620 method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=440.462082ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:54 request_id=f235d12f-6bf2-4483-93e5-5515c87d8b68 method=POST path=/api/v1/users status=201 response_bytes=153 latency=467.557845ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:54 request_id=c039f7d0-879a-4c87-aa6f-b26a7b0be534 method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=380.753972ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:54 request_id=e084cc17-3e34-4b4d-a505-8ee4ee3c2ed9 method=POST path=/api/v1/users status=201 response_bytes=153 latency=430.362118ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:55 request_id=77f5d7ed-f8a4-44bb-a7c6-35105b72861c method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=361.400539ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:55 request_id=2cee44b0-3bde-4274-a345-2a450e37d592 method=POST path=/api/v1/users status=201 response_bytes=153 latency=387.358501ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:56 request_id=8351a9bb-2d81-485e-9461-d3e1e180b1c7 method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=478.984823ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:56 request_id=4784bfab-a8bd-47ce-b569-4b7e519d4f38 method=POST path=/api/v1/users status=201 response_bytes=153 latency=694.465485ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=0876d022-4dd6-45ff-9a5d-74b7b4dece6e method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=507.870998ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=1af0e642-3a02-4cd6-88eb-295353c88b7c method=POST path=/api/v1/chats status=201 response_bytes=514 latency=303.26µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=72b9ccc9-d30f-4da3-9662-05f15722602f method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=651.443µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=81eb5c5b-f9a3-4403-9b8a-5ed360f4a78d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=359.06µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=95416f6f-e84b-4532-bf7e-4c70850733ca method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=594.975µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=c52d75be-211a-414e-bf1d-ce287a437a5a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=253.001µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=3acdd29e-915f-4252-9928-1bb1561a6f8a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=266.628µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=401c57a7-dda1-45a8-854e-1f90fec29b4d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.086266ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=b1a2a6f0-d442-425a-9185-b06af53e0287 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=495.209µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=e28e56e9-5b4b-4634-83a9-8ffa261246d8 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=3.567434ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=1be19fc0-187a-4240-b396-51f254a28846 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.795385ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=83f80360-8ebb-40c8-b3f9-83b596a60dba method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=201.617µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=f56ff57c-7170-41f5-b81f-ace5f259000d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=2.246253ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=51e5b495-8329-4087-afb7-be0ec16db915 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.059136ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=cdc680e8-fda4-45ab-9cc2-976891d745cb method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=3.058181ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=4f378cb9-5335-4a3f-a204-c04c512bc1ac method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=270.587µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=d15ea22e-b4d5-44ba-ad3f-a0d1cbded11d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=3.963708ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=ff677057-1037-4998-a7ee-d3ed7516cc16 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.902029ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=2edd5096-e6f7-41ef-a265-8ec8beeae9f5 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.739251ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=75d1f157-564b-46f0-80f0-a88d7da83642 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=2.940161ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=61cdfd52-4d67-4af2-a3cc-b7384ef86be9 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=191.199µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=fc5faa10-3c15-4e66-9f27-4de48fefa69a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=161.194µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=6dec8a6b-f059-4615-9f28-7c0e265bdced method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=168.403µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=0ba37f3e-5012-4648-9cb9-fe6a9e391286 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=263.753µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=13417c22-fafc-481a-abd5-456111490e41 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=229.539µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=19f8ac4f-fc2a-4a64-9096-3a6cb8c0dc12 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=443.95µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=f1ca84e3-d6f6-4a64-bd98-e2aa24f96793 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=171.696µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=b6ab587d-f519-469f-88e8-9aa15221cfb1 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=160.111µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=12ec636a-0fbf-4c26-9834-59363cc0e5d9 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=346.683µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=94742954-5139-412c-940f-19dde72f8d50 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=217.537µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=2e6d7919-71d0-4411-9f86-a5312c7ea148 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=237.707µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=2acd4a86-79d3-47ac-9370-490faba63dd8 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=222.621µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=9fd113a4-8b1f-487d-83a0-98f21d3106a7 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=356.06µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=51e37132-149a-4c3b-98c9-cfade19a3ecc method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=299.883µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=056f9612-6681-49cb-be83-a5188a4ad784 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=198.45µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=f0933a5e-5e7d-4f67-9d21-b3cdc26b5ee7 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=367.978µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=fd5381a8-23d5-4e49-a2b3-a7446b8dc94a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=368.145µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=18cb05e3-b296-47b9-b011-996dd1069d13 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=680.406µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=8b636c5e-df70-4e1c-907c-8a516890d49e method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.473581ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=5b7fa9d4-2545-4b7a-bd14-e2a0391d895d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=219.078µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=7e5258f4-6322-4d5d-857d-7724852f18a5 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=179.405µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=700838c9-da94-4e08-889e-e3346b73d285 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=197.325µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=cc55fc35-3e25-4d9c-b4ce-1aa9f7a296ed method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=193.741µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=d21bae1c-8414-4fef-ae5e-59ecc5c8e481 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=171.612µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=9ae11a53-4372-4cf8-9459-bb9055e5bb9f method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=268.212µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=4ae0bd79-fb34-41fa-aaff-47459dead558 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=177.614µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=c49603b9-6709-4f40-826b-0cb39c439bb5 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=170.237µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=ef856d83-34ef-46ee-b047-82ceaa8c3813 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=195.325µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=948df662-0eea-4e28-ac14-15d972735bfe method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=277.755µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=6e05a773-85ea-4308-873b-f413fc23ab67 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=210.077µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=741af3a0-5dbf-48ad-a053-d941cd97ee49 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=180.989µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=81450fe0-2922-4349-9f40-d3eb9199456d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=153.193µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=47bffcec-6f7f-4bba-8fc5-321e6d954324 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=167.028µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=4fe65afb-595d-4227-b676-ff0745afdc77 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=22.151061ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=a30669a7-089e-497a-b5ac-d7e3a3330b59 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=221.871µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=7f746257-b6b6-464c-a964-f4b666230e3b method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=278.297µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=cb03cc55-07b0-4c0f-8ff6-73ca6916e076 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=252.209µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=92d14786-6c5f-4cdd-89cb-fb75ef8a2375 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=225.58µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=3c195e16-268b-494b-ad32-9135c3ea6b9e method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=388.899µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=e1f9a9e4-3ae3-477c-8fd6-c8d068d8f68a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=636.358µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=e230085e-920a-4cda-ac31-5a08e846406d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=502.085µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=b26a0e99-c1cf-4895-8a7c-b87f9010e4bf method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=962.245µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=eab81116-9035-4834-8d33-f179a4fc5757 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.862814ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=d8226a69-ff35-4e40-99dd-8c0c42cd15ba method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=358.143µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=a1d94b08-0423-4a8e-985e-8a62e07c0071 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=2.488835ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=ce158939-7a9b-4829-9e30-a9570247b067 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=309.719µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=7694a9dd-aad5-4b96-9d52-bf022c2d6101 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=2.671325ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=a75cbf2d-24f5-44ff-8b3e-2efc8858daeb method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=3.563808ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=cccd74dd-6055-4538-b589-6439bb2e2249 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=199.409µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=682cf78c-492a-4e2e-8d0f-600709d40332 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=268.004µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=b0fe5b42-55a9-4080-b152-17958d1f9f72 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=180.447µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=01ea3680-f345-41b6-9cf5-eaf5a42f98ce method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=201.368µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=41a3b666-77e0-45cd-903a-59c37d094a19 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=209.66µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=52fb0977-6696-48ed-914f-56bb16207ec5 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=314.261µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=a306642c-bb87-41a5-9c51-8d3dea67923b method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=266.67µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=47909112-0b12-4627-a977-eabc090eec23 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=277.297µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=628fa77e-5549-4bca-8ffb-671089e4a4e4 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=227.83µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=115e720e-d906-4299-a557-478100f07ffa method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=561.136µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=fdffc6bf-74ff-4e02-a849-d86f8469edf9 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=180.823µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=70c555f2-9f81-45c3-9cb1-85b4e80106f7 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=188.031µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=897b8deb-775f-4a0d-ac02-b8eca6e6a4ca method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=168.445µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=5b02ee7d-ae2b-45fa-8e5d-e796648368a4 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=278.255µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=59aff7ee-4d4d-487f-89dd-a9b9e1df8705 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=228.664µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=6d858392-c3f1-403d-82d7-3790e81b96da method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=232.164µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=5f077336-b854-49e5-8642-22dddecd1680 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=287.299µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=44d32f91-3883-4a4f-9722-4718d1f29ed6 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=363.228µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=b043468b-dcd8-4085-b21b-72427260aa7e method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=265.67µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=c4c49e7c-e296-4263-beb6-232f11a79069 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=178.071µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=22a15da2-c0e5-42ca-b117-18ecea6f4be5 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=178.155µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=9c6590f9-f07f-4bdd-a3fa-ccbfa2b34080 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=296.383µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=06413c5e-5e2f-4a5a-b3d8-72e79e095b1d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=213.16µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=c4fdcea5-2cb3-4852-a3e6-8f2cca4150c6 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=235.748µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=1e5ec364-bd31-459a-9e20-4df15f9201e5 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=162.861µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=97042c78-9f32-4690-bed4-3fdd12e6f90c method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=169.237µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=1294c60c-07eb-49e2-9688-8273b867a7b0 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=410.319µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=6b1d6ba4-31d5-4eca-a5cf-f4ab203fc38f method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=150.275µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=c9717b03-a4c6-437b-80b3-319a1b010200 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=293.008µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=e8d813c8-6743-4004-a193-4f9517cc29f0 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=237.081µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=7163a415-e1ce-4c92-88e9-87d3e7b5ebc4 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=993.375µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=e52dfded-ef1e-4815-9507-8b4c57b32403 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=368.062µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=8c03578f-5787-409f-b5ab-e61013240c28 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=330.056µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=ea8a1f84-ab01-4d6b-b4b2-1edd2745ea4a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=362.228µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=7bd598d0-dfbe-4226-9d16-8815ace71d18 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=4332 latency=1.28755ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=a36de45d-8bf9-4ec2-ae7a-ab0d5badfd91 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=4332 latency=970.455µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=79982f51-85fd-4e19-b8df-6c6865ed1929 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=4332 latency=1.137775ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=6045807f-6a92-440d-b54e-dc7b4eee2e76 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=4332 latency=879.523µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=c4eadc24-2b1e-4318-81cc-90c604831194 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=4332 latency=669.904µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:19:57 request_id=0eb733fc-c439-41b9-b979-c46d54fd5a5b method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=3616 latency=583.306µs
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestConcurrentMessagesAreUnique (8.46s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | PASS
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/app/chat 13.752s
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestSpoolOriginalAndFullValidation
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestSpoolOriginalAndFullValidation (0.00s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestSpoolLimitsBeforeDecode
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestSpoolLimitsBeforeDecode (0.02s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestFilenameAndCancelledUpload
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestFilenameAndCancelledUpload (0.00s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestReconcileRejectsUnsafeGrace
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestReconcileRejectsUnsafeGrace (0.00s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestValid16BitWidePNG
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestValid16BitWidePNG (0.11s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestAttachmentTimestampsUseFixedMicroseconds
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestAttachmentTimestampsUseFixedMicroseconds (0.00s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestFitGeometry
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestFitGeometry (0.00s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestOrientationsAndAlpha
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestOrientationsAndAlpha (0.00s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestEXIFOrientation
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestEXIFOrientation (0.00s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestFenceIntegration
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestFenceIntegration (0.07s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | PASS
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/attachment 1.223s
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/config [no test files]
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain [no test files]
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestUnicodeAndSalt
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestUnicodeAndSalt (2.38s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | PASS
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/password 3.400s
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/repository [no test files]
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestS3WireFixture
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestS3WireFixture (0.01s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestIntegration
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | storage_test.go:84: goose up: 2026/11/10 18:20:05 OK 001_initial.sql (21.11ms)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:20:05 OK 002_idempotency.sql (1.75ms)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:20:05 OK 003_attachments.sql (5.64ms)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:20:05 OK 004_message_attachments.sql (1.97ms)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:20:05 OK 005_async_attachments.sql (5.92ms)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:20:05 OK 006_attachment_jobs.sql (4ms)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:20:05 OK 007_attachment_outbox.sql (2.56ms)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:20:05 OK 008_attachment_replays.sql (3.23ms)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:20:05 OK 009_backfill_pipeline.sql (2.32ms)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:20:05 OK 010_storage_cleanup.sql (817.31µs)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:20:05 goose: successfully migrated database to version: 10
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | storage_test.go:85: goose up: 2026/11/10 18:20:05 goose: no migrations to run. current version: 10
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestIntegration/registration_race
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | storage_test.go:121: 12 concurrent INSERTs: 1 success, 11 unique conflicts
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestIntegration/rollback
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | storage_test.go:139: failed second member INSERT left 0 chats and 0 members
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestIntegration/lab4_attachments_and_reconciliation
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | lab4_test.go:248: ACL, original bytes, cross-chat attachment rejection, ordered/concurrent idempotency and absent=[] passed
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | lab4_test.go:321: dry-run={Apply:false GraceSeconds:90 ObjectsScanned:5 MetadataScanned:2 BytesScanned:106 ListRequestsEstimate:1 StatRequests:3 DBQueries:14 Orphans:1 Missing:1 FreshSkipped:1 LockedSkipped:1 ReferencedMissing:1 Deleted:0 MarkedFailed:0 DurationMS:15 Actions:[{Kind:orphan Key:original/7a8e9f88-b271-4b9e-9431-b9aa433f1489 Applied:false} {Kind:missing Key:original/76f08381-064d-45b3-afa7-3e8bcb6a5dc3 Applied:false}]} apply={Apply:true GraceSeconds:90 ObjectsScanned:5 MetadataScanned:2 BytesScanned:106 ListRequestsEstimate:1 StatRequests:3 DBQueries:15 Orphans:1 Missing:1 FreshSkipped:1 LockedSkipped:1 ReferencedMissing:1 Deleted:1 MarkedFailed:1 DurationMS:7 Actions:[{Kind:orphan Key:original/7a8e9f88-b271-4b9e-9431-b9aa433f1489 Applied:true} {Kind:missing Key:original/76f08381-064d-45b3-afa7-3e8bcb6a5dc3 Applied:true}]} repeat={Apply:true GraceSeconds:90 ObjectsScanned:4 MetadataScanned:2 BytesScanned:100 ListRequestsEstimate:1 StatRequests:1 DBQueries:9 Orphans:0 Missing:0 FreshSkipped:1 LockedSkipped:1 ReferencedMissing:0 Deleted:0 MarkedFailed:0 DurationMS:3 Actions:[]}; fresh, locked and referenced objects retained
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestIntegration/keyset_and_explain
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | storage_test.go:193: EXPLAIN on 10,000 messages, cursor near the end (9,000):
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | storage_test.go:199: Limit (cost=0.29..17.99 rows=51 width=142) (actual time=0.013..0.032 rows=51 loops=1)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | storage_test.go:199: Buffers: shared hit=10
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | storage_test.go:199: -> Index Scan using messages_history_idx on messages m (cost=0.29..347.47 rows=1000 width=142) (actual time=0.012..0.027 rows=51 loops=1)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | storage_test.go:199: Index Cond: ((chat_id = 'f74d97f7-bb21-47ea-9177-5f171f6cead5'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.9+00'::timestamp with time zone, '00000000-0000-0000-0000-000000000000'::uuid)))
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | storage_test.go:199: Buffers: shared hit=10
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | storage_test.go:199: Planning Time: 0.034 ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | storage_test.go:199: Execution Time: 0.054 ms
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | storage_test.go:204: keyset traversal returned 10,000 distinct messages, including equal timestamps
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestIntegration/idempotency_race
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | storage_test.go:254: 16 concurrent PostgreSQL requests: one effect, identical replay, changed body conflicts
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestIntegration/goose_legacy_and_down
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | storage_test.go:268: goose up: exit status 1: 2026/11/10 18:20:06 OK 001_initial.sql (2.39ms)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:20:06 OK 002_idempotency.sql (1.26ms)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:20:06 OK 003_attachments.sql (2.48ms)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:20:06 OK 004_message_attachments.sql (2.81ms)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | 2026/11/10 18:20:06 goose run: ERROR 005_async_attachments.sql: failed to run SQL migration: failed to execute SQL query "ALTER TABLE attachments\n DROP CONSTRAINT attachments_status_check,\n ADD CONSTRAINT attachments_status_check CHECK (status IN ('queued','processing','ready','failed')),\n DROP CONSTRAINT attachments_check,\n ADD CONSTRAINT attachments_check CHECK ((status='failed' AND error_code IS NOT NULL) OR (status<>'failed' AND error_code IS NULL)),\n ADD COLUMN variants jsonb NOT NULL DEFAULT '[]',\n ADD COLUMN updated_at timestamptz NOT NULL DEFAULT clock_timestamp(),\n ADD COLUMN pipeline_version integer NOT NULL DEFAULT 1,\n ADD COLUMN staging_key text;": ERROR: column "variants" of relation "attachments" already exists (SQLSTATE 42701)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- FAIL: TestIntegration (0.64s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestIntegration/registration_race (0.03s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestIntegration/rollback (0.00s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestIntegration/lab4_attachments_and_reconciliation (0.07s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestIntegration/keyset_and_explain (0.09s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestIntegration/idempotency_race (0.02s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- FAIL: TestIntegration/goose_legacy_and_down (0.05s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | FAIL
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | FAIL gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/repository/postgres 0.667s
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/session [no test files]
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | === RUN TestPasswordContract
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | --- PASS: TestPasswordContract (0.00s)
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | PASS
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/usecase/chat 1.013s
|
||||
mtusi-lab5_tests.0.wqzm1lukwaby@colima | FAIL
|
||||
mtusi-lab5_tests
|
||||
FAIL: tests failed
|
||||
make: *** [test-integration] Error 1
|
||||
@@ -0,0 +1,389 @@
|
||||
.venv/bin/python scripts/swarm.py test-integration
|
||||
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
|
||||
Install the buildx component to build images with BuildKit:
|
||||
https://docs.docker.com/go/buildx/
|
||||
|
||||
Sending build context to Docker daemon 461.3kB␍
|
||||
Step 1/27 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS goose-builder
|
||||
---> 18b460dd1754
|
||||
Step 2/27 : RUN GOMAXPROCS=2 GOFLAGS=-p=1 GOBIN=/out CGO_ENABLED=0 go install -tags='no_clickhouse no_libsql no_mssql no_mysql no_sqlite3 no_vertica no_ydb no_spanner' github.com/pressly/goose/v3/cmd/goose@v3.27.1
|
||||
---> Using cache
|
||||
---> 15f4b2e3468a
|
||||
Step 3/27 : FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616 AS migrations
|
||||
---> 075c2c1a4068
|
||||
Step 4/27 : COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
---> Using cache
|
||||
---> 6a0ad52336c1
|
||||
Step 5/27 : COPY migrations /migrations
|
||||
---> Using cache
|
||||
---> 01a2e64cbb7d
|
||||
Step 6/27 : COPY infra/migrate.sh /usr/local/bin/migrate
|
||||
---> Using cache
|
||||
---> 7382e24476ff
|
||||
Step 7/27 : USER 10001:10001
|
||||
---> Using cache
|
||||
---> 6c54ddff6a36
|
||||
Step 8/27 : ENTRYPOINT ["/usr/local/bin/migrate"]
|
||||
---> Using cache
|
||||
---> 7e8134892cf2
|
||||
Step 9/27 : CMD ["up"]
|
||||
---> Using cache
|
||||
---> adb6e8d9b58a
|
||||
Step 10/27 : FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS builder
|
||||
---> 18b460dd1754
|
||||
Step 11/27 : WORKDIR /src
|
||||
---> Using cache
|
||||
---> 1ba013278a4a
|
||||
Step 12/27 : RUN apk add --no-cache gcc musl-dev
|
||||
---> Using cache
|
||||
---> a0ea65f0bded
|
||||
Step 13/27 : COPY go.mod go.sum ./
|
||||
---> Using cache
|
||||
---> e98ccecfb093
|
||||
Step 14/27 : RUN go mod download
|
||||
---> Using cache
|
||||
---> 91d546c71507
|
||||
Step 15/27 : COPY cmd ./cmd
|
||||
---> Using cache
|
||||
---> 7d74a0366782
|
||||
Step 16/27 : COPY contracts ./contracts
|
||||
---> Using cache
|
||||
---> 89e9eb49cf2e
|
||||
Step 17/27 : COPY dto ./dto
|
||||
---> Using cache
|
||||
---> b3608ba9d910
|
||||
Step 18/27 : COPY internal ./internal
|
||||
---> 420381f245d1
|
||||
Step 19/27 : COPY migrations ./migrations
|
||||
---> 244708889b45
|
||||
Step 20/27 : ENV GOFLAGS=-p=1 GOMAXPROCS=2
|
||||
---> Running in bf624bf36a2e
|
||||
---> Removed intermediate container bf624bf36a2e
|
||||
---> a86cf22e4c7d
|
||||
Step 21/27 : RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/messenger ./cmd
|
||||
---> Running in f0e750b5bd34
|
||||
---> Removed intermediate container f0e750b5bd34
|
||||
---> e1ea9cbf840a
|
||||
Step 22/27 : RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/reconcile ./cmd/reconcile
|
||||
---> Running in d70ebca4dc47
|
||||
---> Removed intermediate container d70ebca4dc47
|
||||
---> 4669d728553f
|
||||
Step 23/27 : RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/worker ./cmd/worker
|
||||
---> Running in e5f260b0016c
|
||||
---> Removed intermediate container e5f260b0016c
|
||||
---> fe51ba375215
|
||||
Step 24/27 : FROM builder AS tests
|
||||
---> fe51ba375215
|
||||
Step 25/27 : COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
---> 3ef73620b0a6
|
||||
Step 26/27 : ENV GOOSE_MIGRATION_DIR=/src/migrations
|
||||
---> Running in 4b59132a45e1
|
||||
---> Removed intermediate container 4b59132a45e1
|
||||
---> 43905e46829a
|
||||
Step 27/27 : CMD ["go", "test", "-p=1", "-race", "-count=1", "-v", "./..."]
|
||||
---> Running in 9d6cbda904bc
|
||||
---> Removed intermediate container 9d6cbda904bc
|
||||
---> 037b4f43fd3c
|
||||
Successfully built 037b4f43fd3c
|
||||
Successfully tagged mtusi-messenger-tests:lab5
|
||||
4sbaveec2mbbm7q290z3mc4bh
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/cmd [no test files]
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/cmd/reconcile [no test files]
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/cmd/worker [no test files]
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/contracts [no test files]
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestMessageStrictFields
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestMessageStrictFields (0.00s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestTimestampFixedMicroseconds
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestTimestampFixedMicroseconds (0.00s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | PASS
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/dto 1.016s
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestRejectsMalformedJSON
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:34 request_id=a120ebf4-66d8-4d9e-b9ef-404d1f0b8ad1 method=POST path=/api/v1/users status=400 response_bytes=140 latency=186.094µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestRejectsMalformedJSON (0.01s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestHidesForeignChat
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:35 request_id=525ea333-7fbc-4427-8ae2-082330c0b56f method=POST path=/api/v1/users status=201 response_bytes=141 latency=429.523996ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:35 request_id=3a55c465-0b19-4fe6-884c-12b97845202c method=POST path=/api/v1/auth/sessions status=201 response_bytes=269 latency=400.777506ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:36 request_id=91bc227a-7b92-459b-a9c7-c4a640a1ca3c method=POST path=/api/v1/users status=201 response_bytes=147 latency=384.621416ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:36 request_id=da2274f8-4ab2-4c54-981b-4b6375c89c48 method=POST path=/api/v1/auth/sessions status=201 response_bytes=275 latency=418.414288ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:36 request_id=d5be3cdc-dab8-48ae-8e97-027a7839b8d0 method=POST path=/api/v1/chats status=201 response_bytes=163 latency=196.223µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:36 request_id=c68e4735-48e5-4446-acbc-b756b3f00c63 method=GET path=/api/v1/chats/:chat_id status=404 response_bytes=126 latency=55.016µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestHidesForeignChat (1.64s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestRejectsEmptyMessage
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:36 request_id=f144edb2-0a71-4953-9712-670b4307d049 method=POST path=/api/v1/users status=201 response_bytes=157 latency=406.815108ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:37 request_id=a7cab490-48fc-49d4-8104-8eb04cb0e41f method=POST path=/api/v1/auth/sessions status=201 response_bytes=285 latency=405.008764ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:37 request_id=41a94031-c08c-4c45-9b9b-8ad54a797f9b method=POST path=/api/v1/chats status=201 response_bytes=163 latency=106.863µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:37 request_id=f2a1b6f2-94d2-4f39-9bac-ebae19dab481 method=POST path=/api/v1/chats/:chat_id/messages status=400 response_bytes=172 latency=151.21µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestRejectsEmptyMessage (0.82s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestRejectsDuplicateUsername
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:37 request_id=a4e26cce-1333-49cf-ac98-37aba8e40cf9 method=POST path=/api/v1/users status=201 response_bytes=149 latency=384.550494ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:38 request_id=bf6b6a52-a044-4104-b8df-71842f061941 method=POST path=/api/v1/auth/sessions status=201 response_bytes=277 latency=370.705527ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:38 request_id=53201beb-d49c-4fc0-8f28-815f7579b8f5 method=POST path=/api/v1/users status=409 response_bytes=170 latency=370.869332ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestRejectsDuplicateUsername (1.13s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestPaginatesMessagesAcrossMultiplePages
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:38 request_id=ac404967-cf50-4886-ab88-75fba0d66fbe method=POST path=/api/v1/users status=201 response_bytes=151 latency=399.448651ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:39 request_id=f4f96a97-08ed-49bb-8074-506429860102 method=POST path=/api/v1/auth/sessions status=201 response_bytes=279 latency=471.634839ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:39 request_id=eadaf592-9287-4360-86c8-4387b3829097 method=POST path=/api/v1/chats status=201 response_bytes=163 latency=126.203µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:39 request_id=2ac4a3fa-0fb8-40f0-b3a1-7af36163d37a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=197.723µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:39 request_id=52535278-cbce-435e-bd1e-37a433e56dfa method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=179.885µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:39 request_id=5b11d2a6-386b-47be-aff7-317eb4fa2707 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=160.38µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:39 request_id=861d72de-e7b9-4bbc-a5e5-b366f4387472 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=140.582µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:39 request_id=0bddc2b2-b304-498d-9e09-1470cc7d31a7 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=119.618µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:39 request_id=2dc5031e-2f06-46e2-8ac7-0761ddad5e4d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=153.17µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:39 request_id=0d0e5d73-d66f-4083-a5d0-686c6dec4c3c method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=228 latency=159.254µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:39 request_id=ac89c25b-9da9-42e3-9cd1-0c1e1f264ee1 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=725 latency=390.862µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:39 request_id=de3853f3-74ae-4083-bcc8-598bb45ab9b9 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=725 latency=242.07µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:39 request_id=43b8dc81-f545-4a36-a052-6dea583fdff4 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=725 latency=175.425µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:39 request_id=305b99d8-fcb8-4fed-a648-24c5f4e817dc method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=259 latency=121.993µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestPaginatesMessagesAcrossMultiplePages (0.88s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestConcurrentMessagesAreUnique
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:39 request_id=f62e7a14-b7ae-4c24-bc64-cc47ac50dc93 method=POST path=/api/v1/users status=201 response_bytes=153 latency=376.003337ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:40 request_id=9922e1a1-b272-4cb4-807e-9c872404a471 method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=371.739811ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:40 request_id=413c97b5-8149-4c0d-92d5-4d9120882e9a method=POST path=/api/v1/users status=201 response_bytes=153 latency=371.796731ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:40 request_id=417099fe-cbba-430c-ba5f-694776a15347 method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=401.933506ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:41 request_id=2cd09de2-85fe-4ad0-bc87-8187a366a970 method=POST path=/api/v1/users status=201 response_bytes=153 latency=395.859968ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:41 request_id=409307c0-72d4-44c4-9aa5-33b3c5752aa8 method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=396.505304ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:41 request_id=ebec8d8c-e6a1-4c8c-8122-e0130516d2fc method=POST path=/api/v1/users status=201 response_bytes=153 latency=373.820076ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:42 request_id=385f8376-dbcc-4c0f-bd5b-22e6cbf989a4 method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=408.30886ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:42 request_id=2e8f957b-af2d-4f82-890c-17ee5ddd9bdc method=POST path=/api/v1/users status=201 response_bytes=153 latency=401.205396ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:43 request_id=41a56fb0-e2cb-4312-a57c-6457c00f79fe method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=381.081401ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:43 request_id=121e271b-7634-48e5-8395-90b992a18b75 method=POST path=/api/v1/users status=201 response_bytes=153 latency=400.063202ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:43 request_id=cf890726-06a9-4a26-b148-48ad9d16c1f4 method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=377.397779ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:44 request_id=1d7ed2cb-025a-487e-9995-06a61e6ea59f method=POST path=/api/v1/users status=201 response_bytes=153 latency=380.557862ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:44 request_id=fb4f8e2f-725e-4559-beb8-d828632a0f1e method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=395.192982ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:45 request_id=357d86d1-d0be-479a-83df-b91f0da90c9f method=POST path=/api/v1/users status=201 response_bytes=153 latency=371.774229ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:45 request_id=38b565f2-da72-489b-8149-9e55aa927f0d method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=442.382653ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:45 request_id=b7b29434-a765-45ab-a3df-bcd2b31e5642 method=POST path=/api/v1/users status=201 response_bytes=153 latency=372.279093ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=731b7f36-a09c-46b0-beb5-69cec9ba6abe method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=370.335795ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=42c59da2-0dcb-4be0-a7f4-0de2f6a388a6 method=POST path=/api/v1/users status=201 response_bytes=153 latency=375.164369ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=b59fa1d6-c07f-4b0c-a80f-df0c91db11da method=POST path=/api/v1/auth/sessions status=201 response_bytes=281 latency=405.93703ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=092cd05e-deb7-4378-b811-25c9f7cd0bad method=POST path=/api/v1/chats status=201 response_bytes=514 latency=186.533µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=8ca6b6d5-4ae2-4464-8b7c-abdb8835cadd method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=208.303µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=9904aa19-424a-4c52-bcba-ec103dae6fab method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=158.803µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=439132c6-6030-45ae-bb6b-032782ad78d8 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=162.073µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=62bee418-056f-4d68-ad0b-d1494dae9149 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=169.233µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=6f1c1df5-2e1a-4a1f-a1e2-07c9b356c41b method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=168.571µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=e7097d00-0825-45a0-9703-43848b1b86f2 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=187.857µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=94a4778a-b603-4947-99e6-7262cb63a02c method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=178.462µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=61f7f04e-7749-4007-80fa-5348d23cc79b method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=158.596µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=339f3ebd-f56b-46c4-afb4-d838b6d19e22 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=202.095µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=664575f1-de2b-4035-8290-02621be7def0 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=567.213µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=c6933c53-6a84-4462-bd1b-a27c6104dce5 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=276.674µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=0d005f58-b73e-4c0c-80ef-90333f841d6d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.219435ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=571fead6-abcc-4205-a7fd-7d48ce65449a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=875.838µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=ebb9eb40-526f-4139-a951-eb89822d28d7 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.808419ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=8328795d-6c01-4702-831b-9679f1c66839 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=153.215µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=b3030fcc-c444-49d7-a1c2-6132b1baa8da method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=142.662µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=2c933d51-f44b-4fac-a675-72c85774c512 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=484.438µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=c41778c0-56b2-49c1-9a82-1159463cffc6 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=2.414535ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=38ff6efb-454d-4772-8ba8-20683532d351 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.087575ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=4610cbff-d3c7-4083-a7b1-01621d4129cb method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.651312ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=8c2687e3-8b73-4720-bfa5-7596c6fdd5ed method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=3.211241ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=86372bfa-614a-4f92-bf1e-df5b302505bc method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=3.222457ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=a7cd6676-8436-4544-966b-bbc0c0241148 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=766.079µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=70bdf943-11df-447a-bfe1-3a5c22172a0d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=153.299µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=41665126-c28d-4623-943b-12c375e7cd4e method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=187.898µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=f53ba09b-53a2-4071-b898-f828b948e171 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=153.423µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=673d03d2-6c91-435f-8b8c-8aff5b58c314 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=142.455µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=fea6b8ec-d431-492d-b61b-9403f165f818 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=143.863µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=74604d89-3eac-4ee0-8ff1-a70255fe6908 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=167.908µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=42cf5708-e2e9-45c7-addc-375633b507eb method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=157.106µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=d7d86eee-ce6b-4c36-8b29-559b33612678 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=143.241µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=694a46d1-d858-4046-96b4-832eaa0f9983 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=147.09µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=c8afd69d-af62-4dd5-a275-b9446299c738 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=135.378µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=4cf77251-b87b-445b-b1b4-14096daa4bc4 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=135.543µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=2fb59757-2e18-4d3d-855a-2e258a19414f method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=144.856µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=f1d91a2c-c587-49ea-9868-7c70f1abffeb method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=148.415µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=1d2a1995-c266-4a4b-9544-b54480cebd2c method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=139.31µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=3912cb0a-9060-4302-84a5-5d7c786d71c4 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=137.861µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=93908403-558e-450b-866a-58f5a321c88d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=286.317µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=5ee59046-acf0-48c8-bb7d-5f21abe094d8 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=198.163µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=23c591a6-d56b-4018-b130-861d8e0589c8 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=135.999µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=31bbf0d9-a4af-4848-aefa-a771dcd55c40 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=309.453µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=1198591d-c43b-4c9b-bc76-4fad9f4bc40c method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=150.153µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=17e0a733-80ae-4f83-ae88-2fab97a5f044 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=156.734µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=7f40a24a-d447-45d6-beae-8b920e9bdbc7 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=134.592µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=bb29dbe8-0483-400a-9b60-02cd83c15485 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=505.546µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=e0da57fa-9e99-4f0c-8516-abdd4af85e46 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=725.602µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=428d1db9-9475-44e5-9eb6-c2c0b92bf418 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=491.226µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=eea31235-f85e-43df-bc23-9f6f0e7e7adb method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.944666ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=57a62d96-2f93-408e-9eb2-ce3e13c70a29 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.149243ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=1f5dd0c0-80f3-443d-a7ae-62c5aed88439 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.051817ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=2de77a11-98c7-45f5-91da-31b23e2d91c5 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=468.836µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=ac732004-5639-4c64-a815-de0e49ed3321 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=2.150691ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=54228bc8-0df7-4a23-b2d1-03ae892bd7f2 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.314626ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=d0d42de0-7fb6-46ae-b3bf-ca0d5950b03f method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.556204ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=68605d50-22f1-4dcb-88b3-a956b64e5cb3 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=366.981µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=d1b73e5c-4917-4a78-9c82-8add850b5079 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=282.924µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=dddebfc6-6f64-479f-80c3-87030922367c method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=295.381µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=4f3b527c-4137-4cb2-9473-49d56a420bbb method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=147.049µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=b9b06cbc-f7ac-44d6-9811-0fa2543cca70 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=153.34µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=e732f927-fe6d-40b9-a9ad-7782274e3650 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=345.377µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=0f10e634-118c-4cef-990c-1a7abb919ab5 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=360.07µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=4be5aad6-3a1d-494e-b0de-29e3a2972552 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=183.76µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=eddafdc2-c9b9-43d1-88f4-10f1c56071d2 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=134.964µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=b6c0615f-dce5-4631-aa5f-7dc2bf061681 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=290.705µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=a6c82fb3-0419-4bfb-badb-e4f45ca50d92 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=347.984µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=41704ab7-1120-4aba-84e8-628dc70275b1 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=589.562µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=76201778-5847-487a-b229-629354621449 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=1.083023ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=c0d50461-50d5-45a9-aaad-5af34d30a440 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=120.52µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=c1d344b9-dba4-4392-9e54-1efa06170360 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=169.605µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=f64ae733-f80b-4c1c-a953-e9ff5d10113b method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=128.011µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=6e66ae23-1cdf-4620-a8eb-0c12e6f01495 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=128.425µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=fb60631d-2a25-4a80-bddf-6667c0e12e2c method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=144.111µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=17c0b29d-7dd4-4b61-ade5-695194f19a68 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=124.824µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=6aa57338-428c-45a8-9d77-bd8c524f58d0 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=151.685µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=c886be6f-ee67-44a8-abe6-84e489cf975c method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=196.921µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=de16609f-4c14-412f-a4f1-f28d527599db method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=145.891µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=6876ce9a-90c3-4431-a056-7508ae43b034 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=118.988µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=2849e735-0d5e-4ab1-9932-d8be2bcdf65c method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=126.603µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=a883d328-3055-45f2-b971-ce43be573940 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=125.445µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=9f5f45ed-6b88-458d-9525-9326030919e1 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=126.356µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=0f74d6b0-8931-464a-aa5a-f26ad12daec4 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=119.94µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=fbdc3ebd-e88b-4864-8131-8ad4b89eb410 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=143.158µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=a7ba86ee-181b-4476-a7ab-a734c4ee266c method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=134.84µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=5e51912a-012a-4c56-9313-ceb9d44c4cc5 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=261.485µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=a3130f83-d27c-4ec2-87d3-59027067ea6a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=124.245µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=b9e5b9b3-bbd6-4568-8753-d4351dc96839 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=147.545µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=4565e89e-caa9-4e4d-a078-a7ba9cbc479d method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=140.593µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=3df97f91-bacf-4194-a2df-e91b8a94d2a8 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=176.723µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:46 request_id=27f66f60-b97d-4d3e-9503-1af72c291662 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=127.225µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:47 request_id=64e38cb8-6eb5-4a3a-a01d-090dccca1035 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=152.636µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:47 request_id=ae0c3b4f-fa7e-4f02-abf9-c4e5ca5f4236 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=199.983µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:47 request_id=58d8552c-cda1-47d2-8881-d1a43b03ad3e method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=129.335µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:47 request_id=1dab28fb-6c71-4aa4-b8d5-da8e86da9e8a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=172.743µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:47 request_id=ce0e5337-dc4f-4b11-8afc-1edf7653bf7f method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=347.195µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:47 request_id=28900f9b-33f1-4266-8950-5b7ed26d3867 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=143.56µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:47 request_id=cfcd75a4-9fc8-4bd7-82ff-929b69ce829a method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=131.59µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:47 request_id=9fd19029-673f-4935-9668-84a2d0e683d5 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=124.839µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:47 request_id=4ef3f1ae-50c1-413e-8c4e-1dafa5fb2d1c method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=137.803µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:47 request_id=cbcb3daa-1979-4392-bc47-6f5b20ea3070 method=POST path=/api/v1/chats/:chat_id/messages status=201 response_bytes=239 latency=289.151µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:47 request_id=a5ea6313-9465-4d20-b068-2553d3bee370 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=4332 latency=776.079µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:47 request_id=48187e18-3ecd-4fbd-a062-c6de8a354daf method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=4332 latency=1.41448ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:47 request_id=1fc7fb98-1c6d-4376-832c-530e21630c58 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=4332 latency=694.317µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:47 request_id=abfeb221-d940-4411-a679-64678c036f6e method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=4332 latency=606.963µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:47 request_id=b0e89015-1603-402a-939c-eb16b757c1a6 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=4332 latency=536.633µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:47 request_id=01fed6c0-16a3-4df6-9b1b-bb20b74d7fe2 method=GET path=/api/v1/chats/:chat_id/messages status=200 response_bytes=3616 latency=481.751µs
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestConcurrentMessagesAreUnique (7.82s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | PASS
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/app/chat 13.393s
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestSpoolOriginalAndFullValidation
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestSpoolOriginalAndFullValidation (0.00s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestSpoolLimitsBeforeDecode
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestSpoolLimitsBeforeDecode (0.03s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestFilenameAndCancelledUpload
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestFilenameAndCancelledUpload (0.01s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestReconcileRejectsUnsafeGrace
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestReconcileRejectsUnsafeGrace (0.00s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestValid16BitWidePNG
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestValid16BitWidePNG (0.10s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestAttachmentTimestampsUseFixedMicroseconds
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestAttachmentTimestampsUseFixedMicroseconds (0.00s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestFitGeometry
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestFitGeometry (0.00s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestOrientationsAndAlpha
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestOrientationsAndAlpha (0.00s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestEXIFOrientation
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestEXIFOrientation (0.00s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestFenceIntegration
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestFenceIntegration (0.07s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | PASS
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/attachment 1.244s
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/config [no test files]
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain [no test files]
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestUnicodeAndSalt
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestUnicodeAndSalt (2.70s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | PASS
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/password 3.754s
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/repository [no test files]
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestS3WireFixture
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestS3WireFixture (0.00s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestIntegration
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:85: goose up: 2026/11/10 18:24:55 OK 001_initial.sql (16.88ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:55 OK 002_idempotency.sql (1.65ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:55 OK 003_attachments.sql (3.72ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:55 OK 004_message_attachments.sql (1.35ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:55 OK 005_async_attachments.sql (4.89ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:55 OK 006_attachment_jobs.sql (2.81ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:55 OK 007_attachment_outbox.sql (2.14ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:55 OK 008_attachment_replays.sql (3.36ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:55 OK 009_backfill_pipeline.sql (1.54ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:55 OK 010_storage_cleanup.sql (431.27µs)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:55 goose: successfully migrated database to version: 10
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:86: goose up: 2026/11/10 18:24:55 goose: no migrations to run. current version: 10
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestIntegration/registration_race
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:122: 12 concurrent INSERTs: 1 success, 11 unique conflicts
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestIntegration/rollback
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:140: failed second member INSERT left 0 chats and 0 members
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestIntegration/lab4_attachments_and_reconciliation
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | lab4_test.go:248: ACL, original bytes, cross-chat attachment rejection, ordered/concurrent idempotency and absent=[] passed
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | lab4_test.go:321: dry-run={Apply:false GraceSeconds:90 ObjectsScanned:5 MetadataScanned:2 BytesScanned:106 ListRequestsEstimate:1 StatRequests:3 DBQueries:14 Orphans:1 Missing:1 FreshSkipped:1 LockedSkipped:1 ReferencedMissing:1 Deleted:0 MarkedFailed:0 DurationMS:9 Actions:[{Kind:orphan Key:original/93a9cd5a-2728-4884-9071-a77f1e762d68 Applied:false} {Kind:missing Key:original/fc633700-4e23-4d86-a40c-6242cfad8d27 Applied:false}]} apply={Apply:true GraceSeconds:90 ObjectsScanned:5 MetadataScanned:2 BytesScanned:106 ListRequestsEstimate:1 StatRequests:3 DBQueries:15 Orphans:1 Missing:1 FreshSkipped:1 LockedSkipped:1 ReferencedMissing:1 Deleted:1 MarkedFailed:1 DurationMS:7 Actions:[{Kind:orphan Key:original/93a9cd5a-2728-4884-9071-a77f1e762d68 Applied:true} {Kind:missing Key:original/fc633700-4e23-4d86-a40c-6242cfad8d27 Applied:true}]} repeat={Apply:true GraceSeconds:90 ObjectsScanned:4 MetadataScanned:2 BytesScanned:100 ListRequestsEstimate:1 StatRequests:1 DBQueries:9 Orphans:0 Missing:0 FreshSkipped:1 LockedSkipped:1 ReferencedMissing:0 Deleted:0 MarkedFailed:0 DurationMS:2 Actions:[]}; fresh, locked and referenced objects retained
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestIntegration/keyset_and_explain
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:194: EXPLAIN on 10,000 messages, cursor near the end (9,000):
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:200: Limit (cost=0.29..17.99 rows=51 width=142) (actual time=0.023..0.041 rows=51 loops=1)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:200: Buffers: shared hit=10
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:200: -> Index Scan using messages_history_idx on messages m (cost=0.29..347.47 rows=1000 width=142) (actual time=0.022..0.036 rows=51 loops=1)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:200: Index Cond: ((chat_id = '4f6f6bd1-9d3d-4b0a-b567-b15a8a04c64f'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.9+00'::timestamp with time zone, '00000000-0000-0000-0000-000000000000'::uuid)))
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:200: Buffers: shared hit=10
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:200: Planning Time: 0.027 ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:200: Execution Time: 0.068 ms
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:205: keyset traversal returned 10,000 distinct messages, including equal timestamps
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestIntegration/idempotency_race
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:255: 16 concurrent PostgreSQL requests: one effect, identical replay, changed body conflicts
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestIntegration/goose_legacy_and_down
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:265: goose down-to: 2026/11/10 18:24:56 OK 010_storage_cleanup.sql (2.55ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 009_backfill_pipeline.sql (467.83µs)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 008_attachment_replays.sql (3.28ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 007_attachment_outbox.sql (3.2ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 006_attachment_jobs.sql (3.22ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 005_async_attachments.sql (2.97ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 goose: no migrations to run. current version: 4
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:271: goose up: 2026/11/10 18:24:56 OK 001_initial.sql (1.76ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 002_idempotency.sql (1.26ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 003_attachments.sql (478.98µs)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 004_message_attachments.sql (2.98ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 005_async_attachments.sql (6.7ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 006_attachment_jobs.sql (2.98ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 007_attachment_outbox.sql (1.94ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 008_attachment_replays.sql (2.86ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 009_backfill_pipeline.sql (2.12ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 010_storage_cleanup.sql (485.17µs)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 goose: successfully migrated database to version: 10
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:272: goose up: 2026/11/10 18:24:56 goose: no migrations to run. current version: 10
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:279: adopted legacy schema: all existing messages are unchanged
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:280: goose reset: 2026/11/10 18:24:56 OK 010_storage_cleanup.sql (2.13ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 009_backfill_pipeline.sql (705.12µs)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 008_attachment_replays.sql (2.89ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 007_attachment_outbox.sql (2.62ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 006_attachment_jobs.sql (3.52ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 005_async_attachments.sql (3.49ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 004_message_attachments.sql (4.03ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 003_attachments.sql (3.47ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 002_idempotency.sql (961.4µs)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 001_initial.sql (8.51ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:285: goose up: 2026/11/10 18:24:56 OK 001_initial.sql (10.59ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 002_idempotency.sql (1.5ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 003_attachments.sql (3.42ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 004_message_attachments.sql (1.18ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 005_async_attachments.sql (3.95ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 006_attachment_jobs.sql (2.66ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 007_attachment_outbox.sql (1.8ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 008_attachment_replays.sql (2.38ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 009_backfill_pipeline.sql (1.43ms)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 OK 010_storage_cleanup.sql (484.05µs)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | 2026/11/10 18:24:56 goose: successfully migrated database to version: 10
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | storage_test.go:289: down and up succeeded in isolated schema
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestIntegration (0.72s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestIntegration/registration_race (0.03s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestIntegration/rollback (0.00s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestIntegration/lab4_attachments_and_reconciliation (0.06s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestIntegration/keyset_and_explain (0.08s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestIntegration/idempotency_race (0.01s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestIntegration/goose_legacy_and_down (0.20s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | PASS
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/repository/postgres 1.752s
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | ? gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/session [no test files]
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | === RUN TestPasswordContract
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | --- PASS: TestPasswordContract (0.00s)
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | PASS
|
||||
mtusi-lab5_tests.0.ei8mkr461zio@colima | ok gitflic.ru/akselbant/mtusi2026lab1-fork/internal/usecase/chat 1.018s
|
||||
mtusi-lab5_tests
|
||||
@@ -0,0 +1,3 @@
|
||||
.venv/bin/python tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:18085"
|
||||
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,7 @@
|
||||
width,height,concurrency,prefetch,offered,accepted,completed,throughput_rps,ready_p95_ms,after_accept_p95_ms,upload_p95_ms,queue_lag_peak_seconds,rss_peak_bytes
|
||||
512,512,1,1,20,20,20,3.316,4761.802,4554.64,328.115,4.078925,33816576
|
||||
512,512,2,4,20,20,20,4.013,4327.625,4169.426,173.305,3.172338,56823808
|
||||
512,512,4,8,20,20,20,3.903,4453.48,4281.149,191.95,2.665913,94711808
|
||||
1536,1536,1,1,20,20,20,0.774,22792.626,21836.999,1073.912,21.476154,77754368
|
||||
1536,1536,2,4,20,20,20,0.851,21471.061,20489.723,1147.664,18.202527,140812288
|
||||
1536,1536,4,8,20,20,20,0.847,20744.497,19885.435,1134.032,16.602282,235130880
|
||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 160 KiB |
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 84 KiB |
@@ -0,0 +1,2 @@
|
||||
.venv/bin/python tests/smoke.py --base-url "http://localhost:18085"
|
||||
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,19 @@
|
||||
Fresh lab5 validation, 2026-11-10.
|
||||
Root independent checks:
|
||||
make check validate: exit 0.
|
||||
go vet ./...: exit 0.
|
||||
./scripts/compose.sh config --quiet: exit 0.
|
||||
docker stack config -c stack.yaml: exit 0.
|
||||
sh -n scripts/*.sh infra/*.sh: exit 0.
|
||||
Worker checks:
|
||||
go test -race ./...: exit 0.
|
||||
make test: exit 0, lab5 scenario on port18085.
|
||||
make test-integration: exit 0 on repeat, including 005-010 up/down-to4/legacy/reset/up.
|
||||
Integration initial failure was an inherited fixture that dropped the migration journal from an already-lab5 schema.
|
||||
The fixture now models an actual lab4 schema (down-to4) before legacy-journal adoption.
|
||||
Fault cases: all 11 groups verified across the initial main phase and --tail-only repeat.
|
||||
The original full invocation exited 1 due to a test stop-helper race; it is not claimed as a full green run.
|
||||
make test-persistence: exit 0; own stack restart preserved confirmed data and existing session.
|
||||
make test-failover: exit 0; one of two API replicas stopped, 123 successful writes, 1 failed attempt, recovery 0.696s.
|
||||
Public contracts and tests match skeleton276dbda; optional private tests cover added requirements.
|
||||
Historical evidence/lab4-* is not used as current lab5 evidence.
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"idempotency": {
|
||||
"parallel_requests": 16,
|
||||
"instances": [
|
||||
"rz3qizaxp0s2bguzbs57me0op",
|
||||
"xcgz2hubz1xrzmrkoyrgwq0tq"
|
||||
],
|
||||
"unique_message_ids": 1
|
||||
},
|
||||
"failovers": [
|
||||
{
|
||||
"action": "stop-one",
|
||||
"target": "rz3qizaxp0s2bguzbs57me0op",
|
||||
"duration_seconds": 15.458,
|
||||
"successful_writes": 1078,
|
||||
"failed_attempts": 7,
|
||||
"successful_rps": 69.739,
|
||||
"first_recovery_seconds": 1.349,
|
||||
"max_success_gap_seconds": 1.055,
|
||||
"instances_before": [
|
||||
"rz3qizaxp0s2bguzbs57me0op",
|
||||
"xcgz2hubz1xrzmrkoyrgwq0tq"
|
||||
],
|
||||
"instances_after": [
|
||||
"j7awgfnedlt9ne1esywrappxx",
|
||||
"xcgz2hubz1xrzmrkoyrgwq0tq"
|
||||
],
|
||||
"confirmed_messages_checked": 1229,
|
||||
"duplicate_bodies": 0
|
||||
},
|
||||
{
|
||||
"action": "stop-one",
|
||||
"target": "xcgz2hubz1xrzmrkoyrgwq0tq",
|
||||
"duration_seconds": 15.467,
|
||||
"successful_writes": 1091,
|
||||
"failed_attempts": 7,
|
||||
"successful_rps": 70.537,
|
||||
"first_recovery_seconds": 1.384,
|
||||
"max_success_gap_seconds": 1.057,
|
||||
"instances_before": [
|
||||
"j7awgfnedlt9ne1esywrappxx",
|
||||
"xcgz2hubz1xrzmrkoyrgwq0tq"
|
||||
],
|
||||
"instances_after": [
|
||||
"5vy560hk6k0q3eicqodd9dp2z",
|
||||
"j7awgfnedlt9ne1esywrappxx"
|
||||
],
|
||||
"confirmed_messages_checked": 1251,
|
||||
"duplicate_bodies": 0
|
||||
}
|
||||
],
|
||||
"rolling_update": {
|
||||
"action": "update",
|
||||
"target": null,
|
||||
"duration_seconds": 44.156,
|
||||
"successful_writes": 3362,
|
||||
"failed_attempts": 0,
|
||||
"successful_rps": 76.139,
|
||||
"first_recovery_seconds": null,
|
||||
"max_success_gap_seconds": 0.152,
|
||||
"instances_before": [
|
||||
"5vy560hk6k0q3eicqodd9dp2z",
|
||||
"j7awgfnedlt9ne1esywrappxx"
|
||||
],
|
||||
"instances_after": [
|
||||
"j201rqxerkxdq0vbcw3armc3m",
|
||||
"uqyjmps3u9fyl976lpj944pc5"
|
||||
],
|
||||
"confirmed_messages_checked": 3519,
|
||||
"duplicate_bodies": 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
module gitflic.ru/akselbant/mtusi2026lab1-fork
|
||||
|
||||
go 1.26.4
|
||||
|
||||
require (
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/jackc/pgx/v5 v5.7.6
|
||||
github.com/labstack/echo/v4 v4.13.4
|
||||
github.com/minio/minio-go/v7 v7.0.95
|
||||
github.com/redis/go-redis/v9 v9.12.1
|
||||
github.com/swaggest/swgui v1.8.9
|
||||
golang.org/x/crypto v0.39.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/go-ini/ini v1.67.0 // indirect
|
||||
github.com/goccy/go-json v0.10.5 // indirect
|
||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.11 // indirect
|
||||
github.com/labstack/gommon v0.4.2 // indirect
|
||||
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/minio/crc64nvme v1.0.2 // indirect
|
||||
github.com/minio/md5-simd v1.1.2 // indirect
|
||||
github.com/philhofer/fwd v1.2.0 // indirect
|
||||
github.com/rs/xid v1.6.0 // indirect
|
||||
github.com/tinylib/msgp v1.3.0 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/fasttemplate v1.2.2 // indirect
|
||||
github.com/vearutop/statigz v1.4.0 // indirect
|
||||
golang.org/x/net v0.41.0 // indirect
|
||||
golang.org/x/sync v0.15.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
golang.org/x/text v0.26.0 // indirect
|
||||
golang.org/x/time v0.11.0 // indirect
|
||||
)
|
||||
@@ -0,0 +1,90 @@
|
||||
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
|
||||
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
||||
github.com/bool64/dev v0.2.45 h1:3nLKhAS/6Oklk3Mt2lHYSN/Cb4tdAD77KLwzeP+6eYE=
|
||||
github.com/bool64/dev v0.2.45/go.mod h1:iJbh1y/HkunEPhgebWRNcs8wfGq7sjvJ6W5iabL8ACg=
|
||||
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
|
||||
github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
|
||||
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
|
||||
github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
|
||||
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
||||
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
||||
github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A=
|
||||
github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
|
||||
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
|
||||
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
||||
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
|
||||
github.com/jackc/pgx/v5 v5.7.6 h1:rWQc5FwZSPX58r1OQmkuaNicxdmExaEz5A2DO2hUuTk=
|
||||
github.com/jackc/pgx/v5 v5.7.6/go.mod h1:aruU7o91Tc2q2cFp5h4uP3f6ztExVpyVv88Xl/8Vl8M=
|
||||
github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
|
||||
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
|
||||
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
|
||||
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
|
||||
github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/klauspost/cpuid/v2 v2.2.11 h1:0OwqZRYI2rFrjS4kvkDnqJkKHdHaRnCm68/DY4OxRzU=
|
||||
github.com/klauspost/cpuid/v2 v2.2.11/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
||||
github.com/labstack/echo/v4 v4.13.4 h1:oTZZW+T3s9gAu5L8vmzihV7/lkXGZuITzTQkTEhcXEA=
|
||||
github.com/labstack/echo/v4 v4.13.4/go.mod h1:g63b33BZ5vZzcIUF8AtRH40DrTlXnx4UMC8rBdndmjQ=
|
||||
github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=
|
||||
github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU=
|
||||
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
||||
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/minio/crc64nvme v1.0.2 h1:6uO1UxGAD+kwqWWp7mBFsi5gAse66C4NXO8cmcVculg=
|
||||
github.com/minio/crc64nvme v1.0.2/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg=
|
||||
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
|
||||
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
|
||||
github.com/minio/minio-go/v7 v7.0.95 h1:ywOUPg+PebTMTzn9VDsoFJy32ZuARN9zhB+K3IYEvYU=
|
||||
github.com/minio/minio-go/v7 v7.0.95/go.mod h1:wOOX3uxS334vImCNRVyIDdXX9OsXDm89ToynKgqUKlo=
|
||||
github.com/philhofer/fwd v1.2.0 h1:e6DnBTl7vGY+Gz322/ASL4Gyp1FspeMvx1RNDoToZuM=
|
||||
github.com/philhofer/fwd v1.2.0/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/redis/go-redis/v9 v9.12.1 h1:k5iquqv27aBtnTm2tIkROUDp8JBXhXZIVu1InSgvovg=
|
||||
github.com/redis/go-redis/v9 v9.12.1/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
|
||||
github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU=
|
||||
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/swaggest/swgui v1.8.9 h1:cxAgIwouPpZPlvX68jY5fpwarzLbkc8/IL6DMj+H460=
|
||||
github.com/swaggest/swgui v1.8.9/go.mod h1:eTJfgwudbyw9xMwqO26vs82ei2u6//JnUAofx2vGB3M=
|
||||
github.com/tinylib/msgp v1.3.0 h1:ULuf7GPooDaIlbyvgAxBV/FI7ynli6LZ1/nVUNu+0ww=
|
||||
github.com/tinylib/msgp v1.3.0/go.mod h1:ykjzy2wzgrlvpDCRc4LA8UXy6D8bzMSuAF3WD57Gok0=
|
||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
|
||||
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
|
||||
github.com/vearutop/statigz v1.4.0 h1:RQL0KG3j/uyA/PFpHeZ/L6l2ta920/MxlOAIGEOuwmU=
|
||||
github.com/vearutop/statigz v1.4.0/go.mod h1:LYTolBLiz9oJISwiVKnOQoIwhO1LWX1A7OECawGS8XE=
|
||||
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
|
||||
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
|
||||
golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
|
||||
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
|
||||
golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8=
|
||||
golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
|
||||
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
|
||||
golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0=
|
||||
golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
+21
-4
@@ -1,7 +1,24 @@
|
||||
# Инфраструктура студента
|
||||
# Инфраструктура lab5
|
||||
|
||||
Здесь разместите конфигурации выбранных сервисов; основную топологию — в корневом compose.yaml/stack.yaml. `compose.example.yaml` — только worksheet ролей и намеренно не запускается. `contracts/infrastructure.json` задаёт минимальные роли, не готовые образы/пароли.
|
||||
HAProxy направляет HTTP в две API-реплики.
|
||||
PostgreSQL хранит сообщения, метаданные, jobs, outbox и audit replay.
|
||||
Redis хранит сессии и Streams с consumer group `image-workers-v1`.
|
||||
Redis использует AOF и `appendfsync always`; Pub/Sub не используется.
|
||||
MinIO хранит приватные staging и конечные варианты. Worker работает отдельным сервисом.
|
||||
|
||||
В REPORT.md сопоставьте роль → service name → версия/digest → health/readiness → volume → сеть/порт → способ передачи credentials. Приведите bootstrap (schema, bucket, broker topology, а с lab6 provisioning) и безопасное повторение этих команд.
|
||||
Основной запуск: `make up`. API: http://localhost:18085.
|
||||
Остановка с сохранением volumes: `make down`.
|
||||
Compose запускает те же роли с одной API-репликой.
|
||||
Скрипты не читают `.env`; bootstrap создаёт Docker secrets.
|
||||
Redis имеет лимит памяти 384MiB и `maxmemory 256mb`, политика `noeviction`.
|
||||
Worker имеет лимит 1CPU/1536MiB; API — по 1CPU/1536MiB.
|
||||
|
||||
Приложение строится из исходников. Не используйте заранее существующий образ преподавательского сервера вместо своей реализации. Restart hook перезапускает все соответствующие stores с volumes; failover hook останавливает только заданную API-реплику.
|
||||
Миграции goose 005–010 добавляют состояния, jobs, outbox, audit и cleanup.
|
||||
Миграция 009 переводит прежние оригиналы в устойчивый staging без потери байтов.
|
||||
При обновлении API останавливаются перед миграциями, затем запускается новая версия.
|
||||
Swarm configs Redis и S3 policy используют суффикс `_v5`.
|
||||
Это позволяет обновить прежний стенд без изменения immutable configs.
|
||||
|
||||
Порты PostgreSQL, Redis, MinIO и worker не опубликованы.
|
||||
S3 policy разрешает API/worker только `original/*` и `staging/*` своего bucket.
|
||||
Версии образов, протокол отказов и команды находятся в [REPORT.md](../REPORT.md).
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
global
|
||||
log stdout format raw local0
|
||||
maxconn 1024
|
||||
|
||||
defaults
|
||||
log global
|
||||
mode http
|
||||
timeout connect 1s
|
||||
timeout client 55s
|
||||
timeout server 55s
|
||||
timeout check 1s
|
||||
retries 0
|
||||
option http-server-close
|
||||
|
||||
resolvers docker
|
||||
nameserver dns 127.0.0.11:53
|
||||
resolve_retries 3
|
||||
timeout resolve 1s
|
||||
timeout retry 1s
|
||||
hold valid 1s
|
||||
hold obsolete 1s
|
||||
hold nx 1s
|
||||
hold refused 1s
|
||||
hold timeout 1s
|
||||
|
||||
frontend public
|
||||
bind :8080
|
||||
default_backend api
|
||||
|
||||
backend api
|
||||
balance roundrobin
|
||||
option httpchk
|
||||
http-check send meth GET uri /health/ready ver HTTP/1.1 hdr Host api
|
||||
http-check expect status 200
|
||||
default-server inter 1s fastinter 500ms downinter 1s fall 2 rise 1
|
||||
server-template replica 1-8 tasks.api:8080 check resolvers docker init-addr none
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
# Keep the password out of argv and disable automatic dotenv loading.
|
||||
if [ -n "${POSTGRES_PASSWORD_FILE:-}" ]; then
|
||||
PGPASSWORD=$(cat "$POSTGRES_PASSWORD_FILE")
|
||||
export PGPASSWORD
|
||||
fi
|
||||
exec goose -env /dev/null -dir /migrations -timeout 30s "$@"
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
export MINIO_ROOT_USER="$(cat /run/secrets/s3_root_access_key)"
|
||||
export MINIO_ROOT_PASSWORD="$(cat /run/secrets/s3_root_secret_key)"
|
||||
exec minio server /data --address :9000 --console-address 127.0.0.1:9001
|
||||
@@ -0,0 +1,9 @@
|
||||
bind 0.0.0.0
|
||||
protected-mode no
|
||||
port 6379
|
||||
dir /data
|
||||
appendonly yes
|
||||
appendfsync always
|
||||
save ""
|
||||
maxmemory 256mb
|
||||
maxmemory-policy noeviction
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
export MC_CONFIG_DIR=/tmp/mc
|
||||
mc alias set admin http://minio:9000 "$(cat /run/secrets/s3_root_access_key)" "$(cat /run/secrets/s3_root_secret_key)" >/dev/null
|
||||
mc ready admin >/dev/null
|
||||
mc mb --ignore-existing admin/attachments >/dev/null
|
||||
mc anonymous set none admin/attachments >/dev/null
|
||||
mc admin policy create admin attachments-api /policy.json >/dev/null
|
||||
mc admin user add admin "$(cat /run/secrets/s3_access_key)" "$(cat /run/secrets/s3_secret_key)" >/dev/null
|
||||
mc admin policy attach admin attachments-api --user "$(cat /run/secrets/s3_access_key)" >/dev/null
|
||||
printf '%s\n' 'PASS: private bucket and restricted API account configured.'
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": ["s3:GetBucketLocation"],
|
||||
"Resource": ["arn:aws:s3:::attachments"]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": ["s3:ListBucket"],
|
||||
"Resource": ["arn:aws:s3:::attachments"],
|
||||
"Condition": {"StringLike": {"s3:prefix": ["original/*", "staging/*"]}}
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": ["s3:GetObject", "s3:PutObject", "s3:DeleteObject"],
|
||||
"Resource": ["arn:aws:s3:::attachments/original/*", "arn:aws:s3:::attachments/staging/*"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
# Схема и транзакционные границы
|
||||
|
||||
PostgreSQL — источник истины пользователей, чатов, участников и сообщений.
|
||||
Redis — источник истины сессий: SHA-256 токена → user_id, expires_at; TTL до
|
||||
абсолютного expires_at, без продления при чтении. Logout удаляет ключ.
|
||||
Redis использует AOF с appendfsync always и отдельный именованный volume.
|
||||
|
||||
- users: UUID PK, UNIQUE(username), password_hash (Argon2id), display_name, created_at.
|
||||
- chats: UUID PK, title, created_at; индекс (created_at, id).
|
||||
- chat_members: PK(chat_id, user_id), FK к chats/users; ordinal сохраняет порядок
|
||||
участников; UNIQUE(chat_id, ordinal); индекс (user_id, chat_id).
|
||||
- messages: UUID PK, FK chat_id/sender_id через членство; text, created_at.
|
||||
Индекс (chat_id, created_at, id) отвечает равенству по чату и keyset-предикату
|
||||
(created_at, id) > ($timestamp, $id), ORDER BY created_at, id LIMIT $limit.
|
||||
- goose_db_version: журнал goose CLI; SQL-миграция и запись её версии
|
||||
коммитятся в одной транзакции. Сервис migrations завершается до старта API.
|
||||
|
||||
Регистрация — один INSERT, гонка разрешается UNIQUE, проигравшие получают 409.
|
||||
Создание чата — одна транзакция: INSERT чата, затем участников; любой неверный
|
||||
FK откатывает всю операцию, включая уже вставленных участников.
|
||||
Отправка сообщения — один INSERT с FK на членство. Чтения идут в PostgreSQL,
|
||||
кэша истории нет, подтверждённый COMMIT виден следующему запросу.
|
||||
При конкурентной записи keyset не даёт snapshot: поздний COMMIT с ключом до
|
||||
уже прочитанного cursor может быть пропущен. created_at задаёт PostgreSQL,
|
||||
UUID разрешает совпадения времени; часы не используются как уникальный ID.
|
||||
@@ -0,0 +1,31 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain"
|
||||
)
|
||||
|
||||
func (h *Chat) authorizedChat(c echo.Context, requestedChat domain.Chat) (domain.Chat, bool, error) {
|
||||
chat, err := h.useCase.GetChat(c.Request().Context(), authenticatedUser(c).ID, requestedChat)
|
||||
if err != nil {
|
||||
return domain.Chat{}, false, h.useCaseError(c, err)
|
||||
}
|
||||
return chat, true, nil
|
||||
}
|
||||
|
||||
func (h *Chat) cursorPosition(raw string, present bool, scope, owner string) (*domain.Position, error) {
|
||||
if !present {
|
||||
return nil, nil
|
||||
}
|
||||
if raw == "" {
|
||||
return nil, errors.New("empty cursor")
|
||||
}
|
||||
createdAt, id, err := h.cursor.decode(raw, scope, owner)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &domain.Position{CreatedAt: createdAt, ID: id}, nil
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"context"
|
||||
"mime"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/attachment"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
func (h *Chat) WithAttachments(service *attachment.Service) *Chat { h.attachments = service; return h }
|
||||
func (h *Chat) uploadAttachment(c echo.Context) error {
|
||||
chat, ok, err := h.authorizedChat(c, domain.Chat{ID: c.Param("chat_id")})
|
||||
if err != nil || !ok {
|
||||
return err
|
||||
}
|
||||
filename, present, err := oneQueryValue(c, "filename")
|
||||
if err != nil || !present {
|
||||
return h.invalid(c, "Требуется один filename")
|
||||
}
|
||||
if c.Request().ContentLength > attachment.MaxBytes {
|
||||
return h.writeError(c, 413, "payload_too_large", "Файл превышает 10 MiB")
|
||||
}
|
||||
// Both socket reads and the application operation have a fixed deadline.
|
||||
deadline := time.Now().Add(attachment.UploadTimeout)
|
||||
_ = http.NewResponseController(c.Response().Writer).SetReadDeadline(deadline)
|
||||
defer http.NewResponseController(c.Response().Writer).SetReadDeadline(time.Time{})
|
||||
c.Request().Body = http.MaxBytesReader(c.Response(), c.Request().Body, attachment.MaxBytes+1)
|
||||
a, err := h.attachments.Upload(c.Request().Context(), chat.ID, authenticatedUser(c).ID, filename, c.Request().Header.Get("Content-Type"), c.Request().Body)
|
||||
if err != nil {
|
||||
return h.useCaseError(c, err)
|
||||
}
|
||||
return c.JSON(http.StatusAccepted, a)
|
||||
}
|
||||
func (h *Chat) getAttachment(c echo.Context) error {
|
||||
a, err := h.attachments.Get(c.Request().Context(), c.Param("attachment_id"), authenticatedUser(c).ID)
|
||||
if err != nil {
|
||||
return h.useCaseError(c, err)
|
||||
}
|
||||
return c.JSON(http.StatusOK, a)
|
||||
}
|
||||
func (h *Chat) attachmentContent(c echo.Context) error {
|
||||
a, err := h.attachments.Get(c.Request().Context(), c.Param("attachment_id"), authenticatedUser(c).ID)
|
||||
if err != nil {
|
||||
return h.useCaseError(c, err)
|
||||
}
|
||||
variant, present, err := oneQueryValue(c, "variant")
|
||||
if err != nil {
|
||||
return h.invalid(c, "Некорректный variant")
|
||||
}
|
||||
if a.Status != "ready" {
|
||||
return h.writeError(c, 409, "conflict", "Вложение не готово")
|
||||
}
|
||||
if !present {
|
||||
variant = "original"
|
||||
}
|
||||
a, err = h.attachments.Variant(a, variant)
|
||||
if err != nil {
|
||||
return h.useCaseError(c, err)
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(c.Request().Context(), 45*time.Second)
|
||||
defer cancel()
|
||||
obj, err := h.attachments.Content(ctx, a)
|
||||
if err != nil {
|
||||
return h.useCaseError(c, err)
|
||||
}
|
||||
defer obj.Close()
|
||||
c.Response().Header().Set("Content-Disposition", mime.FormatMediaType("attachment", map[string]string{"filename": a.Filename}))
|
||||
c.Response().Header().Set("X-Content-Type-Options", "nosniff")
|
||||
c.Response().Header().Set("Cache-Control", "private, no-store")
|
||||
return c.Stream(http.StatusOK, a.ContentType, obj)
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/dto"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain"
|
||||
)
|
||||
|
||||
func (h *Chat) createChat(c echo.Context) error {
|
||||
var request dto.CreateChatRequest
|
||||
if err := decodeJSON(c, &request); err != nil {
|
||||
return h.jsonError(c, err)
|
||||
}
|
||||
callerID := authenticatedUser(c).ID
|
||||
chat, err := h.useCase.CreateChat(c.Request().Context(), callerID, createChatRequestToDomain(request))
|
||||
if err != nil {
|
||||
return h.useCaseError(c, err)
|
||||
}
|
||||
return c.JSON(http.StatusCreated, createChatResponseFromDomain(chat))
|
||||
}
|
||||
|
||||
func createChatRequestToDomain(request dto.CreateChatRequest) domain.Chat {
|
||||
return domain.Chat{Title: request.Title, MemberIDs: request.MemberIDs}
|
||||
}
|
||||
|
||||
func createChatResponseFromDomain(chat domain.Chat) dto.CreateChatResponse {
|
||||
return dto.CreateChatResponse{
|
||||
ID: chat.ID, Title: chat.Title, MemberIDs: chat.MemberIDs, CreatedAt: dto.Timestamp(chat.CreatedAt),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"regexp"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/dto"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain"
|
||||
)
|
||||
|
||||
var idempotencyKeyPattern = regexp.MustCompile(`^[A-Za-z0-9._:-]{1,128}$`)
|
||||
|
||||
func (h *Chat) createMessage(c echo.Context) error {
|
||||
request := dto.CreateMessageRequest{ChatID: c.Param("chat_id")}
|
||||
chat, ok, err := h.authorizedChat(c, domain.Chat{ID: request.ChatID})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
if err := decodeJSON(c, &request); err != nil {
|
||||
return h.jsonError(c, err)
|
||||
}
|
||||
request.ChatID = chat.ID
|
||||
|
||||
keys := c.Request().Header.Values("Idempotency-Key")
|
||||
if len(keys) != 1 || !idempotencyKeyPattern.MatchString(keys[0]) {
|
||||
return h.invalid(c, "Требуется Idempotency-Key: ASCII [A-Za-z0-9._:-]{1,128}")
|
||||
}
|
||||
input := createMessageRequestToDomain(request)
|
||||
input.IdempotencyKey = keys[0]
|
||||
message, err := h.useCase.CreateMessage(c.Request().Context(), authenticatedUser(c).ID, input)
|
||||
if err != nil {
|
||||
return h.useCaseError(c, err)
|
||||
}
|
||||
return c.JSON(http.StatusCreated, createMessageResponseFromDomain(message))
|
||||
}
|
||||
|
||||
func createMessageRequestToDomain(request dto.CreateMessageRequest) domain.Message {
|
||||
return domain.Message{ChatID: request.ChatID, Text: request.Text, AttachmentIDs: request.AttachmentIDs}
|
||||
}
|
||||
|
||||
func createMessageResponseFromDomain(message domain.Message) dto.CreateMessageResponse {
|
||||
return dto.CreateMessageResponse{
|
||||
ID: message.ID, ChatID: message.ChatID, SenderID: message.SenderID,
|
||||
Text: message.Text, AttachmentIDs: nonnilIDs(message.AttachmentIDs), CreatedAt: dto.Timestamp(message.CreatedAt),
|
||||
}
|
||||
}
|
||||
|
||||
func nonnilIDs(ids []string) []string {
|
||||
if ids == nil {
|
||||
return []string{}
|
||||
}
|
||||
return ids
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/dto"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain"
|
||||
)
|
||||
|
||||
func (h *Chat) createUser(c echo.Context) error {
|
||||
var request dto.CreateUserRequest
|
||||
if err := decodeJSON(c, &request); err != nil {
|
||||
return h.jsonError(c, err)
|
||||
}
|
||||
user, err := h.useCase.CreateUser(c.Request().Context(), createUserRequestToDomain(request), request.Password)
|
||||
if err != nil {
|
||||
return h.useCaseError(c, err)
|
||||
}
|
||||
return c.JSON(http.StatusCreated, createUserResponseFromDomain(user))
|
||||
}
|
||||
|
||||
func createUserRequestToDomain(request dto.CreateUserRequest) domain.User {
|
||||
return domain.User{Username: request.Username, DisplayName: request.DisplayName}
|
||||
}
|
||||
|
||||
func createUserResponseFromDomain(user domain.User) dto.CreateUserResponse {
|
||||
return dto.CreateUserResponse{
|
||||
ID: user.ID, Username: user.Username, DisplayName: user.DisplayName, CreatedAt: dto.Timestamp(user.CreatedAt),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/dto"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain"
|
||||
)
|
||||
|
||||
func (h *Chat) currentUser(c echo.Context) error {
|
||||
user := authenticatedUser(c)
|
||||
return c.JSON(http.StatusOK, currentUserResponseFromDomain(user))
|
||||
}
|
||||
|
||||
func currentUserResponseFromDomain(user domain.User) dto.CurrentUserResponse {
|
||||
return dto.CurrentUserResponse{
|
||||
ID: user.ID, Username: user.Username, DisplayName: user.DisplayName, CreatedAt: dto.Timestamp(user.CreatedAt),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"crypto/hmac"
|
||||
"crypto/sha256"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type cursorPayload struct {
|
||||
Scope string `json:"scope"`
|
||||
Owner string `json:"owner"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
type cursorCodec struct {
|
||||
secret [32]byte
|
||||
}
|
||||
|
||||
func (c cursorCodec) encode(scope, owner string, createdAt time.Time, id string) string {
|
||||
payload, err := json.Marshal(cursorPayload{
|
||||
Scope: scope,
|
||||
Owner: owner,
|
||||
CreatedAt: createdAt.UTC().Format(time.RFC3339Nano),
|
||||
ID: id,
|
||||
})
|
||||
if err != nil {
|
||||
panic("cannot encode cursor: " + err.Error())
|
||||
}
|
||||
signature := c.sign(payload)
|
||||
return base64.RawURLEncoding.EncodeToString(payload) + "." + base64.RawURLEncoding.EncodeToString(signature)
|
||||
}
|
||||
|
||||
func (c cursorCodec) decode(raw, scope, owner string) (time.Time, string, error) {
|
||||
parts := strings.Split(raw, ".")
|
||||
if len(parts) != 2 {
|
||||
return time.Time{}, "", errors.New("malformed cursor")
|
||||
}
|
||||
payload, err := base64.RawURLEncoding.DecodeString(parts[0])
|
||||
if err != nil {
|
||||
return time.Time{}, "", errors.New("malformed cursor")
|
||||
}
|
||||
signature, err := base64.RawURLEncoding.DecodeString(parts[1])
|
||||
if err != nil || !hmac.Equal(signature, c.sign(payload)) {
|
||||
return time.Time{}, "", errors.New("invalid cursor signature")
|
||||
}
|
||||
var value cursorPayload
|
||||
if err := json.Unmarshal(payload, &value); err != nil {
|
||||
return time.Time{}, "", errors.New("malformed cursor payload")
|
||||
}
|
||||
if value.Scope != scope || value.Owner != owner {
|
||||
return time.Time{}, "", errors.New("cursor belongs to another resource")
|
||||
}
|
||||
parsedID, err := uuid.Parse(value.ID)
|
||||
if err != nil || parsedID.String() != value.ID {
|
||||
return time.Time{}, "", errors.New("malformed cursor id")
|
||||
}
|
||||
createdAt, err := time.Parse(time.RFC3339Nano, value.CreatedAt)
|
||||
if err != nil {
|
||||
return time.Time{}, "", errors.New("malformed cursor timestamp")
|
||||
}
|
||||
return createdAt, value.ID, nil
|
||||
}
|
||||
|
||||
func (c cursorCodec) sign(payload []byte) []byte {
|
||||
mac := hmac.New(sha256.New, c.secret[:])
|
||||
_, _ = mac.Write(payload)
|
||||
return mac.Sum(nil)
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/dto"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain"
|
||||
)
|
||||
|
||||
func (h *Chat) invalid(c echo.Context, message string) error {
|
||||
return h.writeError(c, http.StatusBadRequest, "invalid_request", message)
|
||||
}
|
||||
|
||||
func (h *Chat) jsonError(c echo.Context, err error) error {
|
||||
if errors.Is(err, errUnsupportedMediaType) {
|
||||
return h.writeError(c, http.StatusUnsupportedMediaType, "unsupported_media_type", "Content-Type должен быть application/json")
|
||||
}
|
||||
var tooLarge *http.MaxBytesError
|
||||
if errors.As(err, &tooLarge) {
|
||||
return h.writeError(c, http.StatusRequestEntityTooLarge, "payload_too_large", "Тело запроса слишком большое")
|
||||
}
|
||||
return h.invalid(c, err.Error())
|
||||
}
|
||||
|
||||
func (h *Chat) useCaseError(c echo.Context, err error) error {
|
||||
applicationError, ok := domain.AsApplicationError(err)
|
||||
if !ok {
|
||||
return err
|
||||
}
|
||||
status := http.StatusInternalServerError
|
||||
switch applicationError.Code {
|
||||
case "unsupported_media_type":
|
||||
status = http.StatusUnsupportedMediaType
|
||||
case "rate_limited":
|
||||
status = http.StatusTooManyRequests
|
||||
c.Response().Header().Set("Retry-After", "2")
|
||||
case "payload_too_large":
|
||||
status = http.StatusRequestEntityTooLarge
|
||||
case domain.ErrorUnavailable:
|
||||
status = http.StatusServiceUnavailable
|
||||
case domain.ErrorInvalid:
|
||||
status = http.StatusBadRequest
|
||||
case domain.ErrorUnauthorized:
|
||||
status = http.StatusUnauthorized
|
||||
challenge := `Bearer realm="messenger"`
|
||||
if c.Path() == "/api/v1/auth/sessions" {
|
||||
challenge = `Basic realm="messenger", charset="UTF-8"`
|
||||
}
|
||||
c.Response().Header().Set("WWW-Authenticate", challenge)
|
||||
case domain.ErrorNotFound:
|
||||
status = http.StatusNotFound
|
||||
case domain.ErrorConflict:
|
||||
status = http.StatusConflict
|
||||
}
|
||||
return h.writeError(c, status, string(applicationError.Code), applicationError.Message)
|
||||
}
|
||||
|
||||
func (h *Chat) writeError(c echo.Context, status int, code, message string) error {
|
||||
return c.JSON(status, dto.ErrorResponse{Error: dto.ErrorDetails{
|
||||
Code: code,
|
||||
Message: message,
|
||||
RequestID: requestID(c),
|
||||
}})
|
||||
}
|
||||
|
||||
func (h *Chat) httpErrorHandler(err error, c echo.Context) {
|
||||
if c.Response().Committed {
|
||||
return
|
||||
}
|
||||
status := http.StatusInternalServerError
|
||||
code := "internal_error"
|
||||
message := "Внутренняя ошибка сервера"
|
||||
var httpError *echo.HTTPError
|
||||
if errors.As(err, &httpError) {
|
||||
status = httpError.Code
|
||||
switch status {
|
||||
case http.StatusNotFound:
|
||||
code, message = "not_found", "Объект не найден"
|
||||
case http.StatusMethodNotAllowed, http.StatusBadRequest:
|
||||
code, message = "invalid_request", "Некорректный запрос"
|
||||
}
|
||||
}
|
||||
_ = h.writeError(c, status, code, message)
|
||||
}
|
||||
|
||||
func requestID(c echo.Context) string {
|
||||
value, _ := c.Get(requestIDKey).(string)
|
||||
if value == "" {
|
||||
value = uuid.NewString()
|
||||
c.Set(requestIDKey, value)
|
||||
c.Response().Header().Set("X-Request-Id", value)
|
||||
}
|
||||
return value
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/dto"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain"
|
||||
)
|
||||
|
||||
func (h *Chat) getChat(c echo.Context) error {
|
||||
request := dto.GetChatRequest{ChatID: c.Param("chat_id")}
|
||||
chat, ok, err := h.authorizedChat(c, getChatRequestToDomain(request))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
return c.JSON(http.StatusOK, getChatResponseFromDomain(chat))
|
||||
}
|
||||
|
||||
func getChatRequestToDomain(request dto.GetChatRequest) domain.Chat {
|
||||
return domain.Chat{ID: request.ChatID}
|
||||
}
|
||||
|
||||
func getChatResponseFromDomain(chat domain.Chat) dto.GetChatResponse {
|
||||
return dto.GetChatResponse{
|
||||
ID: chat.ID, Title: chat.Title, MemberIDs: chat.MemberIDs, CreatedAt: dto.Timestamp(chat.CreatedAt),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/dto"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain"
|
||||
)
|
||||
|
||||
func (h *Chat) listChats(c echo.Context) error {
|
||||
limit, err := parseLimit(c)
|
||||
if err != nil {
|
||||
return h.invalid(c, err.Error())
|
||||
}
|
||||
rawCursor, cursorPresent, err := oneQueryValue(c, "cursor")
|
||||
if err != nil {
|
||||
return h.invalid(c, "cursor должен быть указан один раз")
|
||||
}
|
||||
request := dto.ListChatsRequest{Limit: limit, Cursor: rawCursor}
|
||||
userID := authenticatedUser(c).ID
|
||||
position, err := h.cursorPosition(request.Cursor, cursorPresent, "chats", userID)
|
||||
if err != nil {
|
||||
return h.invalid(c, "Некорректный cursor")
|
||||
}
|
||||
|
||||
page, err := h.useCase.ListChats(c.Request().Context(), userID, listChatsRequestToDomain(request, position))
|
||||
if err != nil {
|
||||
return h.useCaseError(c, err)
|
||||
}
|
||||
var next *string
|
||||
if page.HasMore {
|
||||
last := page.Items[len(page.Items)-1]
|
||||
encoded := h.cursor.encode("chats", userID, last.CreatedAt, last.ID)
|
||||
next = &encoded
|
||||
}
|
||||
return c.JSON(http.StatusOK, listChatsResponseFromDomain(page, next))
|
||||
}
|
||||
|
||||
func listChatsRequestToDomain(request dto.ListChatsRequest, position *domain.Position) domain.Pagination {
|
||||
return domain.Pagination{After: position, Limit: request.Limit}
|
||||
}
|
||||
|
||||
func listChatsResponseFromDomain(page domain.ChatPage, nextCursor *string) dto.ListChatsResponse {
|
||||
items := make([]dto.ListChatsItem, 0, len(page.Items))
|
||||
for _, chat := range page.Items {
|
||||
items = append(items, dto.ListChatsItem{
|
||||
ID: chat.ID, Title: chat.Title, MemberIDs: chat.MemberIDs, CreatedAt: dto.Timestamp(chat.CreatedAt),
|
||||
})
|
||||
}
|
||||
return dto.ListChatsResponse{Items: items, NextCursor: nextCursor}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/dto"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain"
|
||||
)
|
||||
|
||||
func (h *Chat) listMessages(c echo.Context) error {
|
||||
request := dto.ListMessagesRequest{ChatID: c.Param("chat_id")}
|
||||
chat, ok, err := h.authorizedChat(c, domain.Chat{ID: request.ChatID})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
limit, err := parseLimit(c)
|
||||
if err != nil {
|
||||
return h.invalid(c, err.Error())
|
||||
}
|
||||
rawCursor, cursorPresent, err := oneQueryValue(c, "cursor")
|
||||
if err != nil {
|
||||
return h.invalid(c, "cursor должен быть указан один раз")
|
||||
}
|
||||
request.ChatID = chat.ID
|
||||
request.Limit = limit
|
||||
request.Cursor = rawCursor
|
||||
position, err := h.cursorPosition(request.Cursor, cursorPresent, "messages", request.ChatID)
|
||||
if err != nil {
|
||||
return h.invalid(c, "Некорректный cursor")
|
||||
}
|
||||
|
||||
page, err := h.useCase.ListMessages(
|
||||
c.Request().Context(), authenticatedUser(c).ID,
|
||||
listMessagesChatToDomain(request), listMessagesPaginationToDomain(request, position),
|
||||
)
|
||||
if err != nil {
|
||||
return h.useCaseError(c, err)
|
||||
}
|
||||
var next *string
|
||||
if page.HasMore {
|
||||
last := page.Items[len(page.Items)-1]
|
||||
encoded := h.cursor.encode("messages", request.ChatID, last.CreatedAt, last.ID)
|
||||
next = &encoded
|
||||
}
|
||||
return c.JSON(http.StatusOK, listMessagesResponseFromDomain(page, next))
|
||||
}
|
||||
|
||||
func listMessagesChatToDomain(request dto.ListMessagesRequest) domain.Chat {
|
||||
return domain.Chat{ID: request.ChatID}
|
||||
}
|
||||
|
||||
func listMessagesPaginationToDomain(request dto.ListMessagesRequest, position *domain.Position) domain.Pagination {
|
||||
return domain.Pagination{After: position, Limit: request.Limit}
|
||||
}
|
||||
|
||||
func listMessagesResponseFromDomain(page domain.MessagePage, nextCursor *string) dto.ListMessagesResponse {
|
||||
items := make([]dto.ListMessagesItem, 0, len(page.Items))
|
||||
for _, message := range page.Items {
|
||||
items = append(items, dto.ListMessagesItem{
|
||||
ID: message.ID, ChatID: message.ChatID, SenderID: message.SenderID,
|
||||
Text: message.Text, AttachmentIDs: nonnilIDs(message.AttachmentIDs), CreatedAt: dto.Timestamp(message.CreatedAt),
|
||||
})
|
||||
}
|
||||
return dto.ListMessagesResponse{Items: items, NextCursor: nextCursor}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/dto"
|
||||
)
|
||||
|
||||
func (h *Chat) liveness(c echo.Context) error {
|
||||
return c.JSON(http.StatusOK, dto.LivenessResponse{Status: "ok"})
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain"
|
||||
)
|
||||
|
||||
const (
|
||||
requestIDKey = "request_id"
|
||||
userKey = "current_user"
|
||||
)
|
||||
|
||||
func (h *Chat) requestIDMiddleware(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
requestID := uuid.NewString()
|
||||
c.Set(requestIDKey, requestID)
|
||||
c.Response().Header().Set("X-Request-Id", requestID)
|
||||
c.Response().Header().Set("X-Instance-Id", h.instanceID)
|
||||
if h.draining.Load() && c.Request().URL.Path != "/health/live" {
|
||||
return h.writeError(c, http.StatusServiceUnavailable, "unavailable", "Реплика завершает работу")
|
||||
}
|
||||
return next(c)
|
||||
}
|
||||
}
|
||||
|
||||
func (h *Chat) authenticate(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
user, err := h.useCase.Authenticate(c.Request().Context(), bearerToken(c))
|
||||
if err != nil {
|
||||
return h.useCaseError(c, err)
|
||||
}
|
||||
c.Set(userKey, user)
|
||||
return next(c)
|
||||
}
|
||||
}
|
||||
|
||||
func authenticatedUser(c echo.Context) domain.User {
|
||||
return c.Get(userKey).(domain.User)
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/dto"
|
||||
)
|
||||
|
||||
func (h *Chat) readiness(c echo.Context) error {
|
||||
ctx, cancel := context.WithTimeout(c.Request().Context(), 2*time.Second)
|
||||
defer cancel()
|
||||
if err := h.useCase.Ready(ctx); err != nil {
|
||||
return h.useCaseError(c, err)
|
||||
}
|
||||
if h.attachments != nil {
|
||||
if err := h.attachments.Ready(ctx); err != nil {
|
||||
return h.useCaseError(c, err)
|
||||
}
|
||||
}
|
||||
return c.JSON(http.StatusOK, dto.ReadinessResponse{Status: "ok"})
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"mime"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultLimit = 50
|
||||
maxLimit = 100
|
||||
maxJSONBody = 1 << 20
|
||||
)
|
||||
|
||||
var errUnsupportedMediaType = errors.New("unsupported media type")
|
||||
|
||||
func decodeJSON(c echo.Context, target any) error {
|
||||
mediaType, _, err := mime.ParseMediaType(c.Request().Header.Get(echo.HeaderContentType))
|
||||
if err != nil || mediaType != echo.MIMEApplicationJSON {
|
||||
return errUnsupportedMediaType
|
||||
}
|
||||
reader := http.MaxBytesReader(c.Response(), c.Request().Body, maxJSONBody)
|
||||
decoder := json.NewDecoder(reader)
|
||||
decoder.DisallowUnknownFields()
|
||||
if err := decoder.Decode(target); err != nil {
|
||||
var tooLarge *http.MaxBytesError
|
||||
if errors.As(err, &tooLarge) {
|
||||
return err
|
||||
}
|
||||
return errors.New("Некорректное JSON-тело")
|
||||
}
|
||||
var extra any
|
||||
err = decoder.Decode(&extra)
|
||||
var tooLarge *http.MaxBytesError
|
||||
if errors.As(err, &tooLarge) {
|
||||
return err
|
||||
}
|
||||
if !errors.Is(err, io.EOF) {
|
||||
return errors.New("JSON-тело должно содержать ровно один объект")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func parseLimit(c echo.Context) (int, error) {
|
||||
raw, present, err := oneQueryValue(c, "limit")
|
||||
if err != nil {
|
||||
return 0, errors.New("limit должен быть указан один раз")
|
||||
}
|
||||
if !present {
|
||||
return defaultLimit, nil
|
||||
}
|
||||
limit, err := strconv.Atoi(raw)
|
||||
if err != nil || limit < 1 || limit > maxLimit {
|
||||
return 0, fmt.Errorf("limit должен быть целым числом от 1 до %d", maxLimit)
|
||||
}
|
||||
return limit, nil
|
||||
}
|
||||
|
||||
func oneQueryValue(c echo.Context, name string) (string, bool, error) {
|
||||
values, present := c.QueryParams()[name]
|
||||
if !present {
|
||||
return "", false, nil
|
||||
}
|
||||
if len(values) != 1 {
|
||||
return "", true, errors.New("query parameter must occur once")
|
||||
}
|
||||
return values[0], true, nil
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/attachment"
|
||||
"log"
|
||||
"os"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/echo/v4/middleware"
|
||||
"github.com/swaggest/swgui/v5emb"
|
||||
)
|
||||
|
||||
// Chat is the HTTP handler and depends only on the application boundary.
|
||||
type Chat struct {
|
||||
attachments *attachment.Service
|
||||
instanceID string
|
||||
draining atomic.Bool
|
||||
useCase UseCase
|
||||
cursor cursorCodec
|
||||
}
|
||||
|
||||
func NewChat(useCase UseCase, cursorKey [32]byte) *Chat {
|
||||
instanceID := os.Getenv("INSTANCE_ID")
|
||||
if instanceID == "" {
|
||||
instanceID = uuid.NewString()
|
||||
}
|
||||
return &Chat{useCase: useCase, cursor: cursorCodec{secret: cursorKey}, instanceID: instanceID}
|
||||
}
|
||||
|
||||
func (h *Chat) Drain() { h.draining.Store(true) }
|
||||
|
||||
func (h *Chat) Router() *echo.Echo {
|
||||
e := echo.New()
|
||||
e.HideBanner = true
|
||||
e.HidePort = true
|
||||
e.HTTPErrorHandler = h.httpErrorHandler
|
||||
e.Use(h.requestIDMiddleware)
|
||||
e.Use(middleware.RequestLoggerWithConfig(middleware.RequestLoggerConfig{
|
||||
HandleError: true,
|
||||
LogLatency: true,
|
||||
LogMethod: true,
|
||||
LogRoutePath: true,
|
||||
LogURIPath: true,
|
||||
LogRequestID: true,
|
||||
LogStatus: true,
|
||||
LogResponseSize: true,
|
||||
LogValuesFunc: func(_ echo.Context, values middleware.RequestLoggerValues) error {
|
||||
path := values.RoutePath
|
||||
if path == "" {
|
||||
path = values.URIPath
|
||||
}
|
||||
log.Printf(
|
||||
"request_id=%s method=%s path=%s status=%d response_bytes=%d latency=%s",
|
||||
values.RequestID, values.Method, path, values.Status, values.ResponseSize, values.Latency,
|
||||
)
|
||||
return nil
|
||||
},
|
||||
}))
|
||||
e.Use(middleware.Recover())
|
||||
|
||||
e.GET("/health/live", h.liveness)
|
||||
e.GET("/health/ready", h.readiness)
|
||||
swaggerUI := echo.WrapHandler(v5emb.New(
|
||||
"MTUSI Messenger",
|
||||
"/swagger/openapi.json",
|
||||
"/swagger/",
|
||||
))
|
||||
e.GET("/swagger", h.swagger)
|
||||
e.GET("/swagger/", swaggerUI)
|
||||
e.GET("/swagger/openapi.json", h.swaggerSpec)
|
||||
e.GET("/swagger/*", swaggerUI)
|
||||
e.POST("/api/v1/users", h.createUser)
|
||||
|
||||
e.POST("/api/v1/auth/sessions", h.createSession)
|
||||
|
||||
api := e.Group("/api/v1", h.authenticate)
|
||||
api.GET("/users/me", h.currentUser)
|
||||
api.DELETE("/auth/sessions/current", h.deleteSession)
|
||||
api.POST("/chats", h.createChat)
|
||||
api.GET("/chats", h.listChats)
|
||||
api.GET("/chats/:chat_id", h.getChat)
|
||||
api.POST("/chats/:chat_id/messages", h.createMessage)
|
||||
api.GET("/chats/:chat_id/messages", h.listMessages)
|
||||
if h.attachments != nil {
|
||||
api.POST("/chats/:chat_id/attachments", h.uploadAttachment)
|
||||
api.GET("/attachments/:attachment_id", h.getAttachment)
|
||||
api.GET("/attachments/:attachment_id/content", h.attachmentContent)
|
||||
}
|
||||
|
||||
return e
|
||||
}
|
||||
@@ -0,0 +1,353 @@
|
||||
package chat_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
chathandler "gitflic.ru/akselbant/mtusi2026lab1-fork/internal/app/chat"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain"
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/repository"
|
||||
chatusecase "gitflic.ru/akselbant/mtusi2026lab1-fork/internal/usecase/chat"
|
||||
)
|
||||
|
||||
type testAPI struct {
|
||||
server *httptest.Server
|
||||
tokens sync.Map
|
||||
}
|
||||
|
||||
type userResponse struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
type chatResponse struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
type messageResponse struct {
|
||||
ID string `json:"id"`
|
||||
Text string `json:"text"`
|
||||
}
|
||||
|
||||
type messagePageResponse struct {
|
||||
Items []messageResponse `json:"items"`
|
||||
NextCursor *string `json:"next_cursor"`
|
||||
}
|
||||
|
||||
type errorResponse struct {
|
||||
Error struct {
|
||||
Code string `json:"code"`
|
||||
} `json:"error"`
|
||||
}
|
||||
|
||||
func newTestAPI(t *testing.T) *testAPI {
|
||||
t.Helper()
|
||||
useCase := chatusecase.New(repository.NewMemory(), &testSessions{values: map[string]domain.Session{}}, time.Hour)
|
||||
server := httptest.NewServer(chathandler.NewChat(useCase, [32]byte{1}).Router())
|
||||
t.Cleanup(server.Close)
|
||||
return &testAPI{server: server}
|
||||
}
|
||||
|
||||
func (a *testAPI) request(t *testing.T, client *http.Client, method, path, actorID, body string, wantStatus int, target any) {
|
||||
t.Helper()
|
||||
request, err := http.NewRequest(method, a.server.URL+path, bytes.NewBufferString(body))
|
||||
if err != nil {
|
||||
t.Fatalf("create request: %v", err)
|
||||
}
|
||||
if body != "" {
|
||||
request.Header.Set("Content-Type", "application/json")
|
||||
request.Header.Set("Idempotency-Key", uuid.NewString())
|
||||
}
|
||||
if actorID != "" {
|
||||
token, _ := a.tokens.Load(actorID)
|
||||
request.Header.Set("Authorization", "Bearer "+token.(string))
|
||||
}
|
||||
response, err := client.Do(request)
|
||||
if err != nil {
|
||||
t.Fatalf("%s %s: %v", method, path, err)
|
||||
}
|
||||
defer response.Body.Close()
|
||||
responseBody, err := io.ReadAll(response.Body)
|
||||
if err != nil {
|
||||
t.Fatalf("read response: %v", err)
|
||||
}
|
||||
if response.StatusCode != wantStatus {
|
||||
t.Fatalf("%s %s: status=%d, want=%d, body=%s", method, path, response.StatusCode, wantStatus, responseBody)
|
||||
}
|
||||
if response.Header.Get("X-Request-Id") == "" {
|
||||
t.Fatalf("%s %s: missing X-Request-Id", method, path)
|
||||
}
|
||||
if target != nil {
|
||||
if err := json.Unmarshal(responseBody, target); err != nil {
|
||||
t.Fatalf("decode response %q: %v", responseBody, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (a *testAPI) createUser(t *testing.T, username string) userResponse {
|
||||
t.Helper()
|
||||
var user userResponse
|
||||
a.request(t, http.DefaultClient, http.MethodPost, "/api/v1/users", "",
|
||||
fmt.Sprintf(`{"username":%q,"display_name":%q,"password":"test-password-12345"}`, username, username), http.StatusCreated, &user)
|
||||
req, err := http.NewRequest(http.MethodPost, a.server.URL+"/api/v1/auth/sessions", nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
req.Header.Set("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(username+":test-password-12345")))
|
||||
response, err := http.DefaultClient.Do(req)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer response.Body.Close()
|
||||
var login struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
if response.StatusCode != http.StatusCreated {
|
||||
t.Fatalf("login status: %d", response.StatusCode)
|
||||
}
|
||||
if err = json.NewDecoder(response.Body).Decode(&login); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
a.tokens.Store(user.ID, login.Token)
|
||||
return user
|
||||
}
|
||||
|
||||
func (a *testAPI) requestError(t *testing.T, method, path, actorID, body string, wantStatus int, wantCode string) {
|
||||
t.Helper()
|
||||
var response errorResponse
|
||||
a.request(t, http.DefaultClient, method, path, actorID, body, wantStatus, &response)
|
||||
if response.Error.Code != wantCode {
|
||||
t.Fatalf("%s %s: error code=%q, want=%q", method, path, response.Error.Code, wantCode)
|
||||
}
|
||||
}
|
||||
|
||||
func (a *testAPI) createChat(t *testing.T, ownerID string, memberIDs []string) chatResponse {
|
||||
t.Helper()
|
||||
body, err := json.Marshal(map[string]any{"title": "test chat", "member_ids": memberIDs})
|
||||
if err != nil {
|
||||
t.Fatalf("encode chat: %v", err)
|
||||
}
|
||||
var chat chatResponse
|
||||
a.request(t, http.DefaultClient, http.MethodPost, "/api/v1/chats", ownerID, string(body), http.StatusCreated, &chat)
|
||||
return chat
|
||||
}
|
||||
|
||||
func (a *testAPI) createMessage(t *testing.T, client *http.Client, actorID, chatID, text string) messageResponse {
|
||||
t.Helper()
|
||||
body, err := json.Marshal(map[string]string{"text": text})
|
||||
if err != nil {
|
||||
t.Fatalf("encode message: %v", err)
|
||||
}
|
||||
var message messageResponse
|
||||
a.request(t, client, http.MethodPost, "/api/v1/chats/"+chatID+"/messages", actorID, string(body), http.StatusCreated, &message)
|
||||
return message
|
||||
}
|
||||
|
||||
func TestRejectsMalformedJSON(t *testing.T) {
|
||||
api := newTestAPI(t)
|
||||
api.requestError(t, http.MethodPost, "/api/v1/users", "",
|
||||
`{"username":`, http.StatusBadRequest, "invalid_request")
|
||||
}
|
||||
|
||||
func TestHidesForeignChat(t *testing.T) {
|
||||
api := newTestAPI(t)
|
||||
owner := api.createUser(t, "owner_user")
|
||||
outsider := api.createUser(t, "outsider_user")
|
||||
chat := api.createChat(t, owner.ID, []string{owner.ID})
|
||||
api.requestError(t, http.MethodGet, "/api/v1/chats/"+chat.ID, outsider.ID,
|
||||
"", http.StatusNotFound, "not_found")
|
||||
}
|
||||
|
||||
func TestRejectsEmptyMessage(t *testing.T) {
|
||||
api := newTestAPI(t)
|
||||
user := api.createUser(t, "empty_message_user")
|
||||
chat := api.createChat(t, user.ID, []string{user.ID})
|
||||
api.requestError(t, http.MethodPost, "/api/v1/chats/"+chat.ID+"/messages", user.ID,
|
||||
`{"text":" "}`, http.StatusBadRequest, "invalid_request")
|
||||
}
|
||||
|
||||
func TestRejectsDuplicateUsername(t *testing.T) {
|
||||
api := newTestAPI(t)
|
||||
api.createUser(t, "duplicate_user")
|
||||
api.requestError(t, http.MethodPost, "/api/v1/users", "",
|
||||
`{"username":"duplicate_user","display_name":"Duplicate","password":"test-password-12345"}`, http.StatusConflict, "conflict")
|
||||
}
|
||||
|
||||
func TestPaginatesMessagesAcrossMultiplePages(t *testing.T) {
|
||||
api := newTestAPI(t)
|
||||
user := api.createUser(t, "pagination_user")
|
||||
chat := api.createChat(t, user.ID, []string{user.ID})
|
||||
for index := 0; index < 7; index++ {
|
||||
api.createMessage(t, http.DefaultClient, user.ID, chat.ID, fmt.Sprintf("message-%d", index))
|
||||
}
|
||||
|
||||
seen := make(map[string]struct{})
|
||||
cursor := ""
|
||||
pageSizes := make([]int, 0, 4)
|
||||
for {
|
||||
path := "/api/v1/chats/" + chat.ID + "/messages?limit=2"
|
||||
if cursor != "" {
|
||||
path += "&cursor=" + url.QueryEscape(cursor)
|
||||
}
|
||||
var page messagePageResponse
|
||||
api.request(t, http.DefaultClient, http.MethodGet, path, user.ID, "", http.StatusOK, &page)
|
||||
pageSizes = append(pageSizes, len(page.Items))
|
||||
for _, message := range page.Items {
|
||||
if _, duplicate := seen[message.ID]; duplicate {
|
||||
t.Fatalf("message %s appeared on multiple pages", message.ID)
|
||||
}
|
||||
seen[message.ID] = struct{}{}
|
||||
}
|
||||
if page.NextCursor == nil {
|
||||
break
|
||||
}
|
||||
cursor = *page.NextCursor
|
||||
}
|
||||
if len(seen) != 7 {
|
||||
t.Fatalf("received %d unique messages, want 7", len(seen))
|
||||
}
|
||||
wantPageSizes := []int{2, 2, 2, 1}
|
||||
if fmt.Sprint(pageSizes) != fmt.Sprint(wantPageSizes) {
|
||||
t.Fatalf("page sizes=%v, want=%v", pageSizes, wantPageSizes)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConcurrentMessagesAreUnique(t *testing.T) {
|
||||
api := newTestAPI(t)
|
||||
|
||||
users := make([]userResponse, 10)
|
||||
memberIDs := make([]string, 10)
|
||||
for index := range users {
|
||||
users[index] = api.createUser(t, fmt.Sprintf("parallel_user_%02d", index))
|
||||
memberIDs[index] = users[index].ID
|
||||
}
|
||||
chat := api.createChat(t, users[0].ID, memberIDs)
|
||||
|
||||
start := make(chan struct{})
|
||||
errors := make(chan error, 10)
|
||||
var waitGroup sync.WaitGroup
|
||||
|
||||
for clientIndex := 0; clientIndex < 10; clientIndex++ {
|
||||
waitGroup.Add(1)
|
||||
go func(clientIndex int) {
|
||||
defer waitGroup.Done()
|
||||
client := &http.Client{Transport: &http.Transport{}, Timeout: 5 * time.Second}
|
||||
defer client.CloseIdleConnections()
|
||||
<-start
|
||||
for messageIndex := 0; messageIndex < 10; messageIndex++ {
|
||||
body, err := json.Marshal(map[string]string{
|
||||
"text": fmt.Sprintf("client-%02d-message-%02d", clientIndex, messageIndex),
|
||||
})
|
||||
if err != nil {
|
||||
errors <- err
|
||||
return
|
||||
}
|
||||
request, err := http.NewRequest(http.MethodPost,
|
||||
api.server.URL+"/api/v1/chats/"+chat.ID+"/messages", bytes.NewReader(body))
|
||||
if err != nil {
|
||||
errors <- err
|
||||
return
|
||||
}
|
||||
request.Header.Set("Content-Type", "application/json")
|
||||
request.Header.Set("Idempotency-Key", uuid.NewString())
|
||||
token, _ := api.tokens.Load(users[clientIndex].ID)
|
||||
request.Header.Set("Authorization", "Bearer "+token.(string))
|
||||
response, err := client.Do(request)
|
||||
if err != nil {
|
||||
errors <- err
|
||||
return
|
||||
}
|
||||
_, readErr := io.Copy(io.Discard, response.Body)
|
||||
closeErr := response.Body.Close()
|
||||
if readErr != nil {
|
||||
errors <- readErr
|
||||
return
|
||||
}
|
||||
if closeErr != nil {
|
||||
errors <- closeErr
|
||||
return
|
||||
}
|
||||
if response.StatusCode != http.StatusCreated {
|
||||
errors <- fmt.Errorf("client %d message %d: status=%d", clientIndex, messageIndex, response.StatusCode)
|
||||
return
|
||||
}
|
||||
}
|
||||
}(clientIndex)
|
||||
}
|
||||
close(start)
|
||||
waitGroup.Wait()
|
||||
close(errors)
|
||||
for err := range errors {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
seenIDs := make(map[string]struct{}, 10*10)
|
||||
seenTexts := make(map[string]struct{}, 10*10)
|
||||
cursor := ""
|
||||
for {
|
||||
path := "/api/v1/chats/" + chat.ID + "/messages?limit=17"
|
||||
if cursor != "" {
|
||||
path += "&cursor=" + url.QueryEscape(cursor)
|
||||
}
|
||||
var page messagePageResponse
|
||||
api.request(t, http.DefaultClient, http.MethodGet, path, users[0].ID, "", http.StatusOK, &page)
|
||||
for _, message := range page.Items {
|
||||
if _, duplicate := seenIDs[message.ID]; duplicate {
|
||||
t.Fatalf("duplicate message ID %s", message.ID)
|
||||
}
|
||||
if _, duplicate := seenTexts[message.Text]; duplicate {
|
||||
t.Fatalf("duplicate message text %q", message.Text)
|
||||
}
|
||||
seenIDs[message.ID] = struct{}{}
|
||||
seenTexts[message.Text] = struct{}{}
|
||||
}
|
||||
if page.NextCursor == nil {
|
||||
break
|
||||
}
|
||||
cursor = *page.NextCursor
|
||||
}
|
||||
if len(seenIDs) != 10*10 || len(seenTexts) != 10*10 {
|
||||
t.Fatalf("received %d unique IDs and %d unique texts, want %d of each",
|
||||
len(seenIDs), len(seenTexts), 10*10)
|
||||
}
|
||||
}
|
||||
|
||||
// Session fake is only used by HTTP unit tests; the server always uses Redis.
|
||||
type testSessions struct {
|
||||
mu sync.Mutex
|
||||
values map[string]domain.Session
|
||||
}
|
||||
|
||||
func (s *testSessions) Ready(context.Context) error { return nil }
|
||||
func (s *testSessions) Put(_ context.Context, key string, value domain.Session) error {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
s.values[key] = value
|
||||
return nil
|
||||
}
|
||||
func (s *testSessions) Get(_ context.Context, key string) (domain.Session, bool, error) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
value, ok := s.values[key]
|
||||
return value, ok, nil
|
||||
}
|
||||
func (s *testSessions) Delete(_ context.Context, key string) (bool, error) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
_, ok := s.values[key]
|
||||
delete(s.values, key)
|
||||
return ok, nil
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/dto"
|
||||
)
|
||||
|
||||
func bearerToken(c echo.Context) string {
|
||||
parts := strings.Fields(c.Request().Header.Get("Authorization"))
|
||||
if len(parts) != 2 || !strings.EqualFold(parts[0], "Bearer") {
|
||||
return ""
|
||||
}
|
||||
return parts[1]
|
||||
}
|
||||
|
||||
func (h *Chat) createSession(c echo.Context) error {
|
||||
username, password, ok := c.Request().BasicAuth()
|
||||
if !ok {
|
||||
c.Response().Header().Set("WWW-Authenticate", `Basic realm="messenger", charset="UTF-8"`)
|
||||
return h.writeError(c, http.StatusUnauthorized, "unauthorized", "Неверные учётные данные")
|
||||
}
|
||||
body, err := io.ReadAll(io.LimitReader(c.Request().Body, 1))
|
||||
if err != nil || len(body) != 0 {
|
||||
return h.invalid(c, "Тело запроса входа должно быть пустым")
|
||||
}
|
||||
login, err := h.useCase.CreateSession(c.Request().Context(), username, password)
|
||||
if err != nil {
|
||||
return h.useCaseError(c, err)
|
||||
}
|
||||
return c.JSON(http.StatusCreated, dto.CreateSessionResponse{
|
||||
Token: login.Token, TokenType: "Bearer", ExpiresAt: dto.Timestamp(login.ExpiresAt), User: createUserResponseFromDomain(login.User),
|
||||
})
|
||||
}
|
||||
|
||||
func (h *Chat) deleteSession(c echo.Context) error {
|
||||
if err := h.useCase.DeleteSession(c.Request().Context(), bearerToken(c)); err != nil {
|
||||
return h.useCaseError(c, err)
|
||||
}
|
||||
return c.NoContent(http.StatusNoContent)
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/contracts"
|
||||
)
|
||||
|
||||
var swaggerOpenAPI = makeSwaggerOpenAPI()
|
||||
|
||||
func (h *Chat) swagger(c echo.Context) error {
|
||||
return c.Redirect(http.StatusTemporaryRedirect, "/swagger/")
|
||||
}
|
||||
|
||||
func (h *Chat) swaggerSpec(c echo.Context) error {
|
||||
return c.Blob(http.StatusOK, echo.MIMEApplicationJSON, swaggerOpenAPI)
|
||||
}
|
||||
|
||||
func makeSwaggerOpenAPI() []byte {
|
||||
var document map[string]any
|
||||
if err := json.Unmarshal(contracts.OpenAPI, &document); err != nil {
|
||||
panic("cannot decode embedded OpenAPI contract: " + err.Error())
|
||||
}
|
||||
// A relative URL keeps Swagger requests on the same scheme, host and port
|
||||
// as the UI. This also works behind a reverse proxy and on a custom PORT.
|
||||
document["servers"] = []map[string]string{{
|
||||
"url": "/",
|
||||
"description": "Текущий адрес Swagger UI",
|
||||
}}
|
||||
encoded, err := json.Marshal(document)
|
||||
if err != nil {
|
||||
panic("cannot encode Swagger OpenAPI contract: " + err.Error())
|
||||
}
|
||||
return encoded
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain"
|
||||
)
|
||||
|
||||
// UseCase is the application boundary required by the HTTP handler.
|
||||
type UseCase interface {
|
||||
Ready(context.Context) error
|
||||
CreateSession(context.Context, string, string) (domain.Login, error)
|
||||
DeleteSession(context.Context, string) error
|
||||
Authenticate(ctx context.Context, token string) (domain.User, error)
|
||||
CreateUser(ctx context.Context, user domain.User, password string) (domain.User, error)
|
||||
CreateChat(ctx context.Context, callerID string, chat domain.Chat) (domain.Chat, error)
|
||||
GetChat(ctx context.Context, callerID string, chat domain.Chat) (domain.Chat, error)
|
||||
ListChats(ctx context.Context, callerID string, pagination domain.Pagination) (domain.ChatPage, error)
|
||||
CreateMessage(ctx context.Context, callerID string, message domain.Message) (domain.Message, error)
|
||||
ListMessages(ctx context.Context, callerID string, chat domain.Chat, pagination domain.Pagination) (domain.MessagePage, error)
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package attachment
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain"
|
||||
"github.com/google/uuid"
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
Concurrency, Prefetch, MaxOutstanding, MaxAttempts, PixelBudget int
|
||||
Timeout, Lease time.Duration
|
||||
}
|
||||
|
||||
func LoadOptions() (Options, error) {
|
||||
o := Options{}
|
||||
for _, v := range []struct {
|
||||
name string
|
||||
target *int
|
||||
def, max int
|
||||
}{
|
||||
{"WORKER_CONCURRENCY", &o.Concurrency, 2, 8}, {"WORKER_PREFETCH", &o.Prefetch, 4, 32},
|
||||
{"MAX_OUTSTANDING_JOBS", &o.MaxOutstanding, 200, 10000}, {"WORKER_MAX_ATTEMPTS", &o.MaxAttempts, 5, 20},
|
||||
{"WORKER_PIXEL_BUDGET", &o.PixelBudget, 40000000, 80000000},
|
||||
} {
|
||||
n := v.def
|
||||
if raw := os.Getenv(v.name); raw != "" {
|
||||
var err error
|
||||
n, err = strconv.Atoi(raw)
|
||||
if err != nil {
|
||||
return o, fmt.Errorf("invalid %s", v.name)
|
||||
}
|
||||
}
|
||||
if n < 1 || n > v.max {
|
||||
return o, fmt.Errorf("invalid %s", v.name)
|
||||
}
|
||||
*v.target = n
|
||||
}
|
||||
for _, v := range []struct {
|
||||
name string
|
||||
target *time.Duration
|
||||
def int
|
||||
}{{"WORKER_TIMEOUT_SECONDS", &o.Timeout, 25}, {"WORKER_LEASE_SECONDS", &o.Lease, 40}} {
|
||||
n := v.def
|
||||
if raw := os.Getenv(v.name); raw != "" {
|
||||
var e error
|
||||
n, e = strconv.Atoi(raw)
|
||||
if e != nil {
|
||||
return o, fmt.Errorf("invalid %s", v.name)
|
||||
}
|
||||
}
|
||||
if n < 1 || n > 300 {
|
||||
return o, fmt.Errorf("invalid %s", v.name)
|
||||
}
|
||||
*v.target = time.Duration(n) * time.Second
|
||||
}
|
||||
if o.Lease < o.Timeout+5*time.Second {
|
||||
return o, fmt.Errorf("worker lease must exceed timeout by at least 5s")
|
||||
}
|
||||
if o.PixelBudget < int(MaxPixels) {
|
||||
return o, fmt.Errorf("WORKER_PIXEL_BUDGET must allow one 40MP image")
|
||||
}
|
||||
return o, nil
|
||||
}
|
||||
func NewAsync(pool *pgxpool.Pool, store *Store, o Options) *Service {
|
||||
s := New(pool, store)
|
||||
s.Async = true
|
||||
s.Options = o
|
||||
return s
|
||||
}
|
||||
func (s *Service) Upload(ctx context.Context, chatID, userID, name, contentType string, body interface{ Read([]byte) (int, error) }) (Attachment, error) {
|
||||
if !s.Async {
|
||||
return s.uploadSync(ctx, chatID, userID, name, contentType, body)
|
||||
}
|
||||
if err := ValidateFilename(name); err != nil {
|
||||
return Attachment{}, err
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(ctx, UploadTimeout)
|
||||
defer cancel()
|
||||
select {
|
||||
case s.slots <- struct{}{}:
|
||||
defer func() { <-s.slots }()
|
||||
case <-ctx.Done():
|
||||
return Attachment{}, unavailable()
|
||||
}
|
||||
original, err := Spool(ctx, body, contentType)
|
||||
if err != nil {
|
||||
return Attachment{}, err
|
||||
}
|
||||
defer original.Close()
|
||||
tx, err := s.Pool.Begin(ctx)
|
||||
if err != nil {
|
||||
return Attachment{}, unavailable()
|
||||
}
|
||||
defer tx.Rollback(context.Background())
|
||||
// All API replicas serialize admission, including inserts before their COMMIT.
|
||||
if _, err = tx.Exec(ctx, `SELECT pg_advisory_xact_lock(578903551)`); err != nil {
|
||||
return Attachment{}, unavailable()
|
||||
}
|
||||
var pending int
|
||||
if err = tx.QueryRow(ctx, `SELECT count(*) FROM attachment_jobs WHERE state IN ('queued','processing')`).Scan(&pending); err != nil {
|
||||
return Attachment{}, unavailable()
|
||||
}
|
||||
if pending >= s.Options.MaxOutstanding {
|
||||
return Attachment{}, appError("rate_limited", "Очередь заполнена; повторите загрузку позднее")
|
||||
}
|
||||
a := Attachment{ID: uuid.NewString(), ChatID: chatID, OwnerID: userID, Filename: name, ContentType: original.ContentType, Size: original.Size, SHA256: original.SHA256, Status: "queued", Variants: []any{}, PipelineVersion: 1}
|
||||
stage := "staging/" + a.ID
|
||||
a.Key = effectKey(a.ID, 1, "original")
|
||||
// The stage lock protects even a slow PUT from the orphan cleaner.
|
||||
if _, err = tx.Exec(ctx, `SELECT pg_advisory_xact_lock(hashtextextended($1,0))`, stage); err != nil {
|
||||
return Attachment{}, unavailable()
|
||||
}
|
||||
if err = s.put(ctx, stage, original.File, original.Size, original.ContentType); err != nil {
|
||||
return Attachment{}, unavailable()
|
||||
}
|
||||
err = tx.QueryRow(ctx, `INSERT INTO attachments(id,chat_id,uploader_id,filename,object_key,content_type,size_bytes,sha256,width,height,status,staging_key) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,'queued',$11) RETURNING created_at,updated_at`, a.ID, chatID, userID, name, a.Key, a.ContentType, a.Size, a.SHA256, original.Width, original.Height, stage).Scan(&a.CreatedAt, &a.UpdatedAt)
|
||||
if err != nil {
|
||||
return Attachment{}, unavailable()
|
||||
}
|
||||
job := uuid.NewString()
|
||||
if _, err = tx.Exec(ctx, `INSERT INTO attachment_jobs(id,attachment_id,state,max_attempts) VALUES($1,$2,'queued',$3)`, job, a.ID, s.Options.MaxAttempts); err != nil {
|
||||
return Attachment{}, unavailable()
|
||||
}
|
||||
if _, err = tx.Exec(ctx, `INSERT INTO attachment_outbox(job_id) VALUES($1)`, job); err != nil {
|
||||
return Attachment{}, unavailable()
|
||||
}
|
||||
if err = tx.Commit(ctx); err != nil {
|
||||
return Attachment{}, unavailable()
|
||||
}
|
||||
return a, nil
|
||||
}
|
||||
func effectKey(id string, version int, name string) string {
|
||||
return fmt.Sprintf("original/%s/v%d/%s", id, version, name)
|
||||
}
|
||||
func (s *Service) Variant(a Attachment, name string) (Attachment, error) {
|
||||
if name == "original" {
|
||||
return a, nil
|
||||
}
|
||||
for _, item := range a.Variants {
|
||||
raw, _ := json.Marshal(item)
|
||||
var v Variant
|
||||
if json.Unmarshal(raw, &v) == nil && v.Name == name {
|
||||
a.Key = effectKey(a.ID, a.PipelineVersion, name)
|
||||
a.ContentType = v.ContentType
|
||||
return a, nil
|
||||
}
|
||||
}
|
||||
return Attachment{}, appError(domain.ErrorNotFound, "Вариант не найден")
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user