diff --git a/client/amqp/amqp_test.go b/client/amqp/amqp_test.go index 8e49cd6..5838e1e 100644 --- a/client/amqp/amqp_test.go +++ b/client/amqp/amqp_test.go @@ -623,7 +623,10 @@ func TestReceiveTaskResponse(t *testing.T) { func startRabbitMQ(ctx context.Context, opts ...containerOpts) (testcontainers.Container, error) { req := testcontainers.ContainerRequest{ - Image: "rabbitmq:4", + // Pin to 4.2 to avoid breaking changes in 4.3+ where AMQP 1.0 v1 address format + // is denied by default and v2 format requires queues to be pre-created. + // See: https://www.rabbitmq.com/docs/amqp#address-v2 + Image: "rabbitmq:4.2", ExposedPorts: []string{"5672/tcp", "5671/tcp", "15672/tcp"}, WaitingFor: wait.ForAll( wait.ForListeningPort("5672/tcp"), diff --git a/integration/helper_test.go b/integration/helper_test.go index f5cc1a6..bd34a60 100644 --- a/integration/helper_test.go +++ b/integration/helper_test.go @@ -114,7 +114,10 @@ func setupTestEnvironment(ctx context.Context, t *testing.T) (*testEnvironment, g.Go(func() error { t.Log("Starting RabbitMQ container...") - rabbitContainer, err := rabbitmq.Run(ctx, "rabbitmq:4-management", + // Pin to 4.2 to avoid breaking changes in 4.3+ where AMQP 1.0 v1 address format + // is denied by default and v2 format requires queues to be pre-created. + // See: https://www.rabbitmq.com/docs/amqp#address-v2 + rabbitContainer, err := rabbitmq.Run(ctx, "rabbitmq:4.2-management", rabbitmq.WithAdminUsername("guest"), rabbitmq.WithAdminPassword("guest"), testcontainers.WithWaitStrategy( diff --git a/regression/helper_test.go b/regression/helper_test.go index c3c53d6..cd96994 100644 --- a/regression/helper_test.go +++ b/regression/helper_test.go @@ -96,7 +96,10 @@ func setupEnv(ctx context.Context, t *testing.T, dbName string) (*testEnvironmen errGrp.Go(func() error { t.Log("Starting RabbitMQ container...") - rabbitContainer, err := rabbitmq.Run(ctx, "rabbitmq:4-management", + // Pin to 4.2 to avoid breaking changes in 4.3+ where AMQP 1.0 v1 address format + // is denied by default and v2 format requires queues to be pre-created. + // See: https://www.rabbitmq.com/docs/amqp#address-v2 + rabbitContainer, err := rabbitmq.Run(ctx, "rabbitmq:4.2-management", testcontainers.WithWaitStrategy( wait.ForAll( wait.ForLog("Server startup complete").WithStartupTimeout(60*time.Second),