test: keep scaling dataset and image provenance controlled
This commit is contained in:
@@ -175,6 +175,36 @@ def main():
|
|||||||
# Чередование снижает систематический дрейф температуры/кэша.
|
# Чередование снижает систематический дрейф температуры/кэша.
|
||||||
for pool in [1, 10] if repeat % 2 else [10, 1]:
|
for pool in [1, 10] if repeat % 2 else [10, 1]:
|
||||||
cases.append(("pool", 2, 32, repeat, pool))
|
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
|
current = None
|
||||||
try:
|
try:
|
||||||
for number, (series, n, c, rep, pool) in enumerate(cases, 1):
|
for number, (series, n, c, rep, pool) in enumerate(cases, 1):
|
||||||
@@ -191,6 +221,23 @@ def main():
|
|||||||
compose(env, "up", "-d", "--no-build", "--wait")
|
compose(env, "up", "-d", "--no-build", "--wait")
|
||||||
current = configuration
|
current = configuration
|
||||||
time.sleep(3)
|
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(
|
with httpx.Client(
|
||||||
base_url=base, trust_env=False, timeout=15
|
base_url=base, trust_env=False, timeout=15
|
||||||
) as client:
|
) as client:
|
||||||
|
|||||||
Reference in New Issue
Block a user