ЛР 5 — БВТ2303 — Брезгунова — на 5

This commit is contained in:
2026-11-13 13:10:15 +03:00
parent 276dbdad8a
commit ab9161be3d
64 changed files with 5191 additions and 34 deletions
+16
View File
@@ -0,0 +1,16 @@
"""Explicit small retention test; shortened TTL is isolated to the test process."""
from verify import BASE,ROOT,EVIDENCE,Client,compose,command,ready,save,DC
client = Client(BASE,timeout=5)
alice,bob,eve,chat = client.bootstrap()
try:
compose('stop','-t','1','worker','publisher')
queued,data = client.attachment(alice,chat)
failed,_ = client.attachment(alice,chat)
proc = command(DC+['run','--rm','--no-deps','test-runner','python','student-tests/maintenance.py',queued['id'],failed['id']])
(EVIDENCE/'staging-retention.txt').write_text(proc.stdout,encoding='utf-8')
finally:
compose('start','publisher','worker')
_,info = ready(client,bob,queued,data)
save('retention-active-recovery.json',{'result':'PASS','job':info})
print('PASS: retention preserves active input, removes expired failed/orphan staging, recovery succeeds.')