integration-test.py: fix time delay check

This commit is contained in:
Simon Li
2022-11-27 21:28:43 +00:00
committed by Pris Nasrat
parent ae5fd64576
commit 20c6a851de

View File

@@ -2,7 +2,7 @@
import argparse
from shutil import which
import subprocess
from time import time
import time
import os
@@ -42,13 +42,13 @@ def check_container_ready(container_name, timeout=60):
"""
Check if container is ready to run tests
"""
now = time()
now = time.time()
while True:
try:
container_check_output(["exec", "-t", container_name, "id"])
return
except subprocess.CalledProcessError:
if time() - now > timeout:
if time.time() - now > timeout:
raise RuntimeError(f"Container {container_name} hasn't started")
time.sleep(5)