lab7: Argon2id из env (замер bench/argon2_bench.py), лимит неудачных входов в Valkey (429 + Retry-After), cap_drop ALL и no-new-privileges, X-Instance-Id = случайный alias

This commit is contained in:
Alexey Bodanyuk
2026-11-27 16:57:24 +03:00
parent 876f610847
commit 05df1695fe
16 changed files with 431 additions and 50 deletions
+3 -5
View File
@@ -20,7 +20,7 @@ import pytest
from PIL import Image
import imagegen
from conftest import (attachment_row, audit, compose, events_of, job_rows, jobctl, psql, queue_depth, s3_keys,
from conftest import (lbctl, attachment_row, audit, compose, events_of, job_rows, jobctl, psql, queue_depth, s3_keys,
s3_size, service_down, service_with_env, wait_healthy, wait_stand)
pytestmark = pytest.mark.stack
@@ -359,11 +359,9 @@ def test_bad_message_is_dead_lettered_not_processed(api, pair):
# ------------------------------------------------------------------ lease, hung worker, shutdown, concurrency
def worker_containers() -> dict[str, str]:
"""hostname (= lease_owner) -> container id of every running worker."""
"""instance alias (= lease_owner, lab 7: random, in /tmp/instance_id) -> container id of every running worker."""
ids = compose("ps", "-q", "worker").stdout.split()
out = subprocess.run(["docker", "inspect", "-f", "{{.Config.Hostname}} {{.Id}}", *ids], capture_output=True,
text=True, check=True).stdout
return dict(line.split() for line in out.splitlines())
return {lbctl.instance_alias(cid): cid for cid in ids}
def test_hung_worker_loses_its_lease_and_cannot_publish(api, pair):