ЛР 4: подтвердить окончательные проверки отказов и целостность доказательств

This commit is contained in:
2026-10-27 13:19:00 +03:00
parent 96007f4c5a
commit 2c7a00948a
5 changed files with 65 additions and 21 deletions
+11 -2
View File
@@ -68,8 +68,17 @@ def main():
except Failure:
assert time.monotonic() - started < 10
time.sleep(.1)
c.message(alice, chat, 'write survives stop')
report['replicas'].append({'container': container, 'uploader': alias, 'downloader': data['headers']['X-Instance-Id'], 'confirmed_stopped': True, 'recovery_seconds': round(time.monotonic() - started, 3), 'sha256': hashlib.sha256(data['bytes']).hexdigest(), 'exit_code': state['ExitCode'], 'oom_killed': state['OOMKilled']})
key = uuid.uuid4().hex
write_failures = 0
while True:
try:
c.message(alice, chat, 'write survives stop', key=key)
break
except Failure:
write_failures += 1
assert time.monotonic() - started < 10
time.sleep(.1)
report['replicas'].append({'container': container, 'uploader': alias, 'downloader': data['headers']['X-Instance-Id'], 'confirmed_stopped': True, 'transient_write_failures': write_failures, 'recovery_seconds': round(time.monotonic() - started, 3), 'sha256': hashlib.sha256(data['bytes']).hexdigest(), 'exit_code': state['ExitCode'], 'oom_killed': state['OOMKilled']})
finally:
docker('compose', 'up', '-d', '--wait', '--no-deps', 'api')
wait(c)