From 13f46b2f64d58aa94a7ae93c1a5563c008f648cd Mon Sep 17 00:00:00 2001 From: mehdihadeli Date: Sun, 3 Sep 2023 01:21:07 +0330 Subject: [PATCH] fix: testcontainer bug --- internal/pkg/rabbitmq/bus/rabbitmq-bus.go | 5 +++++ .../containers/testcontainer/rabbitmq/rabbitmq_container.go | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/internal/pkg/rabbitmq/bus/rabbitmq-bus.go b/internal/pkg/rabbitmq/bus/rabbitmq-bus.go index ba46d7c7..0eab01e2 100644 --- a/internal/pkg/rabbitmq/bus/rabbitmq-bus.go +++ b/internal/pkg/rabbitmq/bus/rabbitmq-bus.go @@ -239,6 +239,11 @@ func (r *rabbitmqBus) ConnectConsumerHandler( } func (r *rabbitmqBus) Start(ctx context.Context) error { + r.logger.Infof( + "rabbitmq is running on host: %s", + r.rabbitmqConnection.Raw().LocalAddr().String(), + ) + for messageType, consumers := range r.messageTypeConsumers { name := typeMapper.GetTypeNameByType(messageType) r.logger.Info(fmt.Sprintf("consuming message type %s", name)) diff --git a/internal/pkg/test/containers/testcontainer/rabbitmq/rabbitmq_container.go b/internal/pkg/test/containers/testcontainer/rabbitmq/rabbitmq_container.go index 328cb419..e6279dc7 100644 --- a/internal/pkg/test/containers/testcontainer/rabbitmq/rabbitmq_container.go +++ b/internal/pkg/test/containers/testcontainer/rabbitmq/rabbitmq_container.go @@ -98,12 +98,6 @@ func (g *rabbitmqTestContainers) CreatingContainerOptions( isConnectable := IsConnectable(host, hostPort.Int(), t) if isConnectable == false { - if dbContainer.IsRunning() { - if err := dbContainer.Terminate(ctx); err != nil { - t.Fatalf("failed to terminate container: %s", err) - } - } - return g.CreatingContainerOptions(context.Background(), t, options...) }