mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-08-23 16:01:57 +00:00
tests: DockerComposer KeyboardInterrupt
make sure we teardown on KeyboardInterrupt
This commit is contained in:
@@ -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)}")
|
||||
|
Reference in New Issue
Block a user