Skip to content

Commit

Permalink
chore: logging for shutdown event listener
Browse files Browse the repository at this point in the history
  • Loading branch information
pcnc committed Dec 4, 2023
1 parent 1495558 commit 64de0af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions testinfra/test_all_in_one.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 64de0af

Please sign in to comment.