Хранить отзывы сессий в PostgreSQL, сохранять U+0000, ограничить ожидание БД
Application / stack (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
Pavel Grigorev
2026-11-06 17:11:03 +03:00
parent 0c6b95cc53
commit f69ad8c27c
31 changed files with 974 additions and 725 deletions
+4 -2
View File
@@ -12,6 +12,7 @@
import base64
from datetime import datetime, timezone
import json
import os
from pathlib import Path
import re
import statistics
@@ -26,6 +27,7 @@ ROOT = Path(__file__).resolve().parents[1]
OUT = ROOT / 'evidence' / 'track2'
WARMUP, RUNS = 3, 15
PROJECT_VOLUME = 'grigoriev-lab2_pgdata_restore'
RESTORE_PORT = int(os.environ.get('RESTORE_API_PORT', '8081'))
VARIANTS = {
'pk_only': [],
@@ -323,8 +325,8 @@ def restore():
in_restored = int(psql("SELECT count(*) FROM messages WHERE text = 'during dump'", service='postgres-restore'))
times['api_restore_ready'] = timed(lambda: compose('up', '-d', '--wait', '--no-build', 'api-restore'))
status_me = api('GET', '/api/v1/users/me', 8081, token)[0]
page = api('GET', '/api/v1/chats/%s/messages' % chat['id'], 8081, token)[1]
status_me = api('GET', '/api/v1/users/me', RESTORE_PORT, token)[0]
page = api('GET', '/api/v1/chats/%s/messages' % chat['id'], RESTORE_PORT, token)[1]
api_ok = status_me == 200 and page['items'] == [message]
mismatches = [k for k in CHECKSUMS if source[k] != restored[k]]
data = {'environment': environment(), 'dump_bytes': dump_bytes, 'times_seconds': times,