test: keep scaling dataset and image provenance controlled

This commit is contained in:
2026-11-15 19:14:16 +03:00
parent e779ff1c49
commit b14fb9a162
+47
View File
@@ -175,6 +175,36 @@ def main():
# Чередование снижает систематический дрейф температуры/кэша.
for pool in [1, 10] if repeat % 2 else [10, 1]:
cases.append(("pool", 2, 32, repeat, pool))
revision = command(
[
"docker",
"image",
"inspect",
env.get("API_IMAGE", "mtusi-messenger:lab3"),
"--format",
'{{index .Config.Labels "org.opencontainers.image.revision"}}',
],
env,
)
meta["runtime_image_revision"] = revision
assert (
command(
[
"git",
"diff",
revision,
"--",
"src",
"migrations",
"pyproject.toml",
"uv.lock",
"Dockerfile",
],
env,
)
== ""
)
meta["runtime_equal_to_source_commit"] = True
current = None
try:
for number, (series, n, c, rep, pool) in enumerate(cases, 1):
@@ -191,6 +221,23 @@ def main():
compose(env, "up", "-d", "--no-build", "--wait")
current = configuration
time.sleep(3)
# Только новая БД изолированного исследовательского проекта.
assert env["COMPOSE_PROJECT_NAME"].startswith("lab3-scaling-")
compose(
env,
"exec",
"-T",
"postgres",
"psql",
"-U",
"messenger",
"-d",
"messenger",
"-v",
"ON_ERROR_STOP=1",
"-c",
"TRUNCATE idempotency,messages,members,chats,sessions,users",
)
with httpx.Client(
base_url=base, trust_env=False, timeout=15
) as client: