mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Add inspect to container debugging
This commit is contained in:
16
.github/integration-test.py
vendored
16
.github/integration-test.py
vendored
@@ -45,9 +45,21 @@ def check_container_ready(container_name, timeout=60):
|
||||
now = time.time()
|
||||
while True:
|
||||
try:
|
||||
container_check_output(["exec", "-t", container_name, "id"])
|
||||
out = container_check_output(["exec", "-t", container_name, "id"])
|
||||
print(out.decode())
|
||||
return
|
||||
except subprocess.CalledProcessError:
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(e)
|
||||
try:
|
||||
out = container_check_output(["inspect", container_name])
|
||||
print(out.decode())
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(e)
|
||||
try:
|
||||
out = container_check_output(["logs", container_name])
|
||||
print(out.decode())
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(e)
|
||||
if time.time() - now > timeout:
|
||||
raise RuntimeError(f"Container {container_name} hasn't started")
|
||||
time.sleep(5)
|
||||
|
||||
Reference in New Issue
Block a user