Проверить ЛР4: сборка MinIO из исходников и результаты полного прогона

This commit is contained in:
Алиса Шурман
2026-11-12 23:01:59 +03:00
parent 7fbdef3a6a
commit 59fc7b96ec
22 changed files with 368 additions and 27 deletions
+7 -1
View File
@@ -38,6 +38,12 @@ try:
with psycopg.connect(dsn) as db:
db.execute("UPDATE attachments SET status='ready' WHERE id=%s", (ids[0],))
db.rollback()
# Even an old intent must survive while a live finalization holds its lock.
with psycopg.connect(dsn) as active:
active.execute('SELECT id FROM attachments WHERE id=%s FOR UPDATE', (ids[0],))
sweep()
storage.client.head_object(Bucket=storage.BUCKET, Key=keys[0])
assert active.execute('SELECT status FROM attachments WHERE id=%s', (ids[0],)).fetchone()[0] == 'pending'
sweep()
sweep() # Idempotent after completion.
with psycopg.connect(dsn) as db:
@@ -50,7 +56,7 @@ try:
assert error.response['ResponseMetadata']['HTTPStatusCode']==404
for key in keys[1:]:
storage.client.head_object(Bucket=storage.BUCKET,Key=key)
print('PASS: private bucket, failed finalization recovery, grace period, ready protection, repeated cleanup')
print('PASS: private bucket, failed finalization recovery, active lock protection, grace period, ready protection, repeated cleanup')
finally:
for key in keys:
storage.client.delete_object(Bucket=storage.BUCKET,Key=key)