1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2025-08-23 07:51:56 +00:00

tests: DockerComposer KeyboardInterrupt

make sure we teardown on KeyboardInterrupt
This commit is contained in:
Niek
2025-02-27 13:46:37 +01:00
parent a6271639ad
commit 545e9cebb6

View File

@@ -511,6 +511,11 @@ class DockerComposer(contextlib.AbstractContextManager):
wait_for_nginxproxy_to_be_ready()
time.sleep(3) # give time to containers to be ready
except KeyboardInterrupt:
logging.warning("KeyboardInterrupt detected! Force cleanup...")
self._down() # Ensure proper shutdown
raise # Re-raise to allow pytest to exit cleanly
except docker.errors.APIError as e:
logging.error(f"Docker API error ({e.status_code}): {e.explanation}")
logging.debug(f"Full error message: {str(e)}")