From d97571634f01c53db7a247beea837ab0baa7ab60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D1=80=D0=B0=D0=B9=D0=BA=D0=B8=D0=BD=20=D0=93=D0=BB?= =?UTF-8?q?=D0=B5=D0=B1?= <31+qu1ck_1337@noreply.gitea.privcloud.tech> Date: Fri, 2 Oct 2026 12:53:26 +0300 Subject: [PATCH] Wait for periodic Docker healthcheck after API restart --- student-tests/lifecycle.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/student-tests/lifecycle.py b/student-tests/lifecycle.py index 2a8ddba2..17ec322b 100644 --- a/student-tests/lifecycle.py +++ b/student-tests/lifecycle.py @@ -17,7 +17,12 @@ chat=c.call('POST','/api/v1/chats',201,actor=a,body={'title':'Lifecycle','member marker='synthetic-private-body-marker';msg=c.message(a,chat,marker)['json'] container=compose('ps','-q','api') inspect=lambda:json.loads(subprocess.check_output(['docker','inspect',container],text=True))[0] -before=inspect();assert before['Config']['User']=='10001:10001' and before['State']['Health']['Status']=='healthy' +before=inspect() +# HTTP readiness can precede Docker's next periodic healthcheck after restart. +deadline=time.monotonic()+20 +while before['State']['Health']['Status']!='healthy' and time.monotonic()