CI GetContainerHealth(): speed up checks

This commit is contained in:
Raphael Defosseux
2024-11-22 08:23:44 +01:00
committed by Robert Schmidt
parent d0b637a020
commit 5f1219bc32
+2 -3
View File
@@ -159,12 +159,11 @@ def GetContainerHealth(ssh, containerName):
return False
if 'db_init' in containerName or 'db-init' in containerName: # exits with 0, there cannot be healthy
return True
time.sleep(5)
for _ in range(3):
for _ in range(8):
result = ssh.run(f'docker inspect --format="{{{{.State.Health.Status}}}}" {containerName}', silent=True)
if result.stdout == 'healthy':
return True
time.sleep(10)
time.sleep(5)
return False
def ExistEnvFilePrint(ssh, wd, prompt='env vars in existing'):