Skip to content

Commit

Permalink
fix: testcontainer bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdihadeli committed Sep 2, 2023
1 parent 77a8958 commit 13f46b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 5 additions & 0 deletions internal/pkg/rabbitmq/bus/rabbitmq-bus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
}

Expand Down

0 comments on commit 13f46b2

Please sign in to comment.