From 08f4e0d9ae62894161d710068e1e676d758f77d2 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 16 Dec 2024 18:29:15 +0000 Subject: [PATCH] Removing in specific scenarios. --- .../tests/core/utilities/testContainerUtils.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/backend-core/tests/core/utilities/testContainerUtils.ts b/packages/backend-core/tests/core/utilities/testContainerUtils.ts index d6c16442f9..bf0cb5228d 100644 --- a/packages/backend-core/tests/core/utilities/testContainerUtils.ts +++ b/packages/backend-core/tests/core/utilities/testContainerUtils.ts @@ -160,8 +160,11 @@ export async function startContainer(container: GenericContainer) { // matching container and it has exited, we remove it before carrying on. This // removes the need to do this removal manually. const existingContainer = getContainerByName(name) - if (existingContainer && existingContainer.State !== "running") { - console.log("--- REMOVING EXISTING CONTAINER --- ") + if ( + existingContainer?.State === "exited" || + existingContainer?.State === "dead" || + existingContainer?.State === "paused" + ) { removeContainer(existingContainer) }