Disable connection recovery in rabbitmq test (#8261)

This commit is contained in:
Lauri Tulmin 2023-04-11 05:18:21 +03:00 committed by GitHub
parent 22df5866b0
commit e03aaed32c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -38,6 +38,7 @@ class RabbitMqTest extends AgentInstrumentationSpecification implements WithRabb
def setupSpec() { def setupSpec() {
startRabbit() startRabbit()
connectionFactory.setAutomaticRecoveryEnabled(false)
} }
def cleanupSpec() { def cleanupSpec() {
@ -277,9 +278,9 @@ class RabbitMqTest extends AgentInstrumentationSpecification implements WithRabb
def "test spring rabbit"() { def "test spring rabbit"() {
setup: setup:
def connectionFactory = new CachingConnectionFactory(connectionFactory) def cachingConnectionFactory = new CachingConnectionFactory(connectionFactory)
AmqpAdmin admin = new RabbitAdmin(connectionFactory) AmqpAdmin admin = new RabbitAdmin(cachingConnectionFactory)
AmqpTemplate template = new RabbitTemplate(connectionFactory) AmqpTemplate template = new RabbitTemplate(cachingConnectionFactory)
def queue = new Queue("some-routing-queue", false, true, true, null) def queue = new Queue("some-routing-queue", false, true, true, null)
runWithSpan("producer parent") { runWithSpan("producer parent") {
@ -316,6 +317,9 @@ class RabbitMqTest extends AgentInstrumentationSpecification implements WithRabb
rabbitSpan(it, 1, "<default>", "some-routing-queue", "receive", queue.name, span(0), producerSpan) rabbitSpan(it, 1, "<default>", "some-routing-queue", "receive", queue.name, span(0), producerSpan)
} }
} }
cleanup:
cachingConnectionFactory.destroy()
} }
def "capture message header as span attributes"() { def "capture message header as span attributes"() {