From 1afce2d2f3a17cdf449a835cf1872a3411de9439 Mon Sep 17 00:00:00 2001 From: ayush-panta Date: Fri, 20 Feb 2026 13:37:02 -0800 Subject: [PATCH] fix: improve container cleanup in e2e aftereach step Signed-off-by: ayush-panta --- command/remove.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/command/remove.go b/command/remove.go index f401ee1..35acb7c 100644 --- a/command/remove.go +++ b/command/remove.go @@ -31,8 +31,13 @@ func RemoveContainers(o *option.Option) { return } + // Stop all containers first to ensure they can be removed + stopArgs := append([]string{"stop", "--time", "1"}, ids...) + New(o, stopArgs...).WithoutCheckingExitCode().Run() + + // Remove containers, ignoring failures to prevent test cleanup from failing args := append([]string{"rm", "--force"}, ids...) - Run(o, args...) + New(o, args...).WithoutCheckingExitCode().Run() } // RemoveVolumes removes all unused local volumes in the testing environment specified by o.