From 3f30eb7692542e8edceac999015f6c6a642e9012 Mon Sep 17 00:00:00 2001 From: bcmmbaga Date: Fri, 27 Dec 2024 18:06:12 +0300 Subject: [PATCH] Terminate tests containers on defer instead of waiting Signed-off-by: bcmmbaga --- management/server/testutil/store.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/management/server/testutil/store.go b/management/server/testutil/store.go index b08315fa5..0ff1e87bd 100644 --- a/management/server/testutil/store.go +++ b/management/server/testutil/store.go @@ -40,9 +40,8 @@ func CreateMysqlTestContainer() (func(), error) { } cleanup := func() { - timeout := 10 * time.Second - if err = container.Stop(ctx, &timeout); err != nil { - log.WithContext(ctx).Warnf("failed to stop container: %s", err) + if err = container.Terminate(ctx); err != nil { + log.WithContext(ctx).Warnf("failed to terminate container: %s", err) } } @@ -72,9 +71,8 @@ func CreatePostgresTestContainer() (func(), error) { } cleanup := func() { - timeout := 10 * time.Second - if err = container.Stop(ctx, &timeout); err != nil { - log.WithContext(ctx).Warnf("failed to stop container: %s", err) + if err = container.Terminate(ctx); err != nil { + log.WithContext(ctx).Warnf("failed to terminate container: %s", err) } }