mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
integration-test.py: fix time delay check
This commit is contained in:
6
.github/integration-test.py
vendored
6
.github/integration-test.py
vendored
@@ -2,7 +2,7 @@
|
|||||||
import argparse
|
import argparse
|
||||||
from shutil import which
|
from shutil import which
|
||||||
import subprocess
|
import subprocess
|
||||||
from time import time
|
import time
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
@@ -42,13 +42,13 @@ def check_container_ready(container_name, timeout=60):
|
|||||||
"""
|
"""
|
||||||
Check if container is ready to run tests
|
Check if container is ready to run tests
|
||||||
"""
|
"""
|
||||||
now = time()
|
now = time.time()
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
container_check_output(["exec", "-t", container_name, "id"])
|
container_check_output(["exec", "-t", container_name, "id"])
|
||||||
return
|
return
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
if time() - now > timeout:
|
if time.time() - now > timeout:
|
||||||
raise RuntimeError(f"Container {container_name} hasn't started")
|
raise RuntimeError(f"Container {container_name} hasn't started")
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user