From e03aaed32c18cc51131d95cd13418c1356957e84 Mon Sep 17 00:00:00 2001 From: Lauri Tulmin Date: Tue, 11 Apr 2023 05:18:21 +0300 Subject: [PATCH] Disable connection recovery in rabbitmq test (#8261) --- .../javaagent/src/test/groovy/RabbitMqTest.groovy | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/instrumentation/rabbitmq-2.7/javaagent/src/test/groovy/RabbitMqTest.groovy b/instrumentation/rabbitmq-2.7/javaagent/src/test/groovy/RabbitMqTest.groovy index c3087921ba..970472c6da 100644 --- a/instrumentation/rabbitmq-2.7/javaagent/src/test/groovy/RabbitMqTest.groovy +++ b/instrumentation/rabbitmq-2.7/javaagent/src/test/groovy/RabbitMqTest.groovy @@ -38,6 +38,7 @@ class RabbitMqTest extends AgentInstrumentationSpecification implements WithRabb def setupSpec() { startRabbit() + connectionFactory.setAutomaticRecoveryEnabled(false) } def cleanupSpec() { @@ -277,9 +278,9 @@ class RabbitMqTest extends AgentInstrumentationSpecification implements WithRabb def "test spring rabbit"() { setup: - def connectionFactory = new CachingConnectionFactory(connectionFactory) - AmqpAdmin admin = new RabbitAdmin(connectionFactory) - AmqpTemplate template = new RabbitTemplate(connectionFactory) + def cachingConnectionFactory = new CachingConnectionFactory(connectionFactory) + AmqpAdmin admin = new RabbitAdmin(cachingConnectionFactory) + AmqpTemplate template = new RabbitTemplate(cachingConnectionFactory) def queue = new Queue("some-routing-queue", false, true, true, null) runWithSpan("producer parent") { @@ -316,6 +317,9 @@ class RabbitMqTest extends AgentInstrumentationSpecification implements WithRabb rabbitSpan(it, 1, "", "some-routing-queue", "receive", queue.name, span(0), producerSpan) } } + + cleanup: + cachingConnectionFactory.destroy() } def "capture message header as span attributes"() {