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()