From 56aaa4a87a77089d0317aec21fd3b6b14fb9b597 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Wed, 31 Aug 2022 16:43:54 -0400 Subject: [PATCH] Fix Observation test race condition The latch is counted down before the `Observation` is stopped --- .../ObservationPropagationChannelInterceptorTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ObservationPropagationChannelInterceptorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ObservationPropagationChannelInterceptorTests.java index 44de3fcaf7..c147ff544c 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ObservationPropagationChannelInterceptorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ObservationPropagationChannelInterceptorTests.java @@ -213,8 +213,8 @@ public class ObservationPropagationChannelInterceptorTests { Observation.createNotStarted("user.code", receiverContext, this.observationRegistry) .observe(() -> { // Let's assume that this is the user code - handleLatch.countDown(); }); + handleLatch.countDown(); }); // This would be the instrumentation code on the sender side (user's code would call e.g. MessageTemplate and this code