forked from mtusi2026/mtusi2026lab4
ЛР 4: подтвердить окончательные проверки отказов и целостность доказательств
This commit is contained in:
+11
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user