Skip to content

Commit 56aaa4a

Browse files
committed
Fix Observation test race condition
The latch is counted down before the `Observation` is stopped
1 parent 9c4c528 commit 56aaa4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-integration-core/src/test/java/org/springframework/integration/channel/interceptor/ObservationPropagationChannelInterceptorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ void observationContextPropagatedOverDirectChannel() throws InterruptedException
213213
Observation.createNotStarted("user.code", receiverContext, this.observationRegistry)
214214
.observe(() -> {
215215
// Let's assume that this is the user code
216-
handleLatch.countDown();
217216
});
217+
handleLatch.countDown();
218218
});
219219

220220
// This would be the instrumentation code on the sender side (user's code would call e.g. MessageTemplate and this code

0 commit comments

Comments
 (0)