From 64de0afe55a27996f509e707520155d45c94aae0 Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Mon, 4 Dec 2023 16:08:34 +0200 Subject: [PATCH] chore: logging for shutdown event listener --- .../etc/supervisor/db-only/shutdown_event_listener.conf | 3 +++ testinfra/test_all_in_one.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docker/all-in-one/etc/supervisor/db-only/shutdown_event_listener.conf b/docker/all-in-one/etc/supervisor/db-only/shutdown_event_listener.conf index 66a9fcde0..06d988d44 100644 --- a/docker/all-in-one/etc/supervisor/db-only/shutdown_event_listener.conf +++ b/docker/all-in-one/etc/supervisor/db-only/shutdown_event_listener.conf @@ -1,3 +1,6 @@ [eventlistener:shutdown_event_listener] command = /usr/local/bin/shutdown_event_listener.py events = SUPERVISOR_STATE_CHANGE_STOPPING,TICK_60 +stdout_logfile=/var/log/services/shutdown_event_listener.log +stdout_logfile_maxbytes=10MB +redirect_stderr=true \ No newline at end of file diff --git a/testinfra/test_all_in_one.py b/testinfra/test_all_in_one.py index 2c71f0dad..91fe3c828 100644 --- a/testinfra/test_all_in_one.py +++ b/testinfra/test_all_in_one.py @@ -68,13 +68,13 @@ def get_health(container: Container) -> str: health = get_health(container) if health == "healthy": break - sleep(1) - attempts += 1 if attempts > 30 or health == "exited": # print container logs for debugging print(container.logs().decode("utf-8")) raise TimeoutError("Container failed to become healthy.") + attempts += 1 + sleep(1) # return a testinfra connection to the container yield testinfra.get_host("docker://" + cast(str, container.name))