From 1b6d25e519012763c0d92e38d986198ddf6d73cf Mon Sep 17 00:00:00 2001 From: Lauri Tulmin Date: Fri, 7 Apr 2023 16:41:40 +0300 Subject: [PATCH] Disable automatic connection recovery in reactor rabbit test (#8243) --- .../src/test/groovy/ReactorRabbitMqTest.groovy | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/instrumentation/rabbitmq-2.7/javaagent/src/test/groovy/ReactorRabbitMqTest.groovy b/instrumentation/rabbitmq-2.7/javaagent/src/test/groovy/ReactorRabbitMqTest.groovy index 5c4f381a9c..875a28ef65 100644 --- a/instrumentation/rabbitmq-2.7/javaagent/src/test/groovy/ReactorRabbitMqTest.groovy +++ b/instrumentation/rabbitmq-2.7/javaagent/src/test/groovy/ReactorRabbitMqTest.groovy @@ -3,9 +3,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -import com.rabbitmq.client.Channel -import com.rabbitmq.client.Connection -import com.rabbitmq.client.ShutdownSignalException import io.opentelemetry.api.trace.SpanKind import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification import io.opentelemetry.semconv.trace.attributes.SemanticAttributes @@ -15,27 +12,15 @@ import reactor.rabbitmq.SenderOptions class ReactorRabbitMqTest extends AgentInstrumentationSpecification implements WithRabbitMqTrait { - // Open connection outside of the test method to ensure that connection can be successfully - // established inside the test method without producing extra spans for connection recovery - Connection conn = connectionFactory.newConnection() - Channel channel = conn.createChannel() - def setupSpec() { startRabbit() + connectionFactory.setAutomaticRecoveryEnabled(false) } def cleanupSpec() { stopRabbit() } - def cleanup() { - try { - channel.close() - conn.close() - } catch (ShutdownSignalException ignored) { - } - } - def "should not fail declaring exchange"() { given: def sender = RabbitFlux.createSender(new SenderOptions().connectionFactory(connectionFactory))