Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/e2e: manually remove containers for better debugging #11772

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tests/e2e/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ def run_container(self, **specs: dict[str, Any]) -> Container:
specs["network"] = self.__network.name
specs["labels"] = self.docker_labels
specs["detach"] = True
specs["auto_remove"] = True
if hasattr(self, "live_server_url"):
specs.setdefault("environment", {})
specs["environment"]["AUTHENTIK_HOST"] = self.live_server_url
Expand All @@ -136,7 +135,7 @@ def output_container_logs(self, container: Container | None = None):
print("::endgroup::")

def tearDown(self):
containers = self.docker_client.containers.list(
containers: list[Container] = self.docker_client.containers.list(
filters={"label": ",".join(f"{x}={y}" for x, y in self.docker_labels.items())}
)
for container in containers:
Expand All @@ -145,6 +144,10 @@ def tearDown(self):
container.kill()
except DockerException:
pass
try:
container.remove(force=True)
except DockerException:
pass
self.__network.remove()


Expand Down
Loading