ЛР 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
+21
View File
@@ -0,0 +1,21 @@
"""Recheck the post-COMMIT/pre-ack fault after the full campaign has drained."""
import json
import time
from verify import EVIDENCE,dbtool,save,check
campaign = json.loads((EVIDENCE/'pipeline-results.json').read_text(encoding='utf-8'))
case = next(x for x in campaign['scenarios'] if x['scenario']=='after_result_commit')
deadline = time.monotonic()+40
while True:
final = dbtool('inspect',case['job']['attachment_id'])
if any(e['event']=='duplicate_ignored' for e in final['events']):
break
check(time.monotonic()<deadline,'committed crash did not redeliver')
time.sleep(0.5)
check(final['objects']==case['job']['objects'],'redelivery rewrote successful objects')
check(final['jobs']==case['job']['jobs'],'redelivery changed committed job')
check('staging/'+final['attachment_id'] not in dbtool('staging')['keys'],'staging cleanup missing')
queue = dbtool('queue')
check(queue['length']==0,'campaign queue did not drain')
save('post-commit-redelivery.json',{'result':'PASS','job':final,'queue':queue})
print('PASS: actual post-COMMIT redelivery was a no-op, staging removed, queue drained.')