From 82bed3f24efaaa4ecce7765abe232d7bb9811e07 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Fri, 4 Oct 2024 10:08:25 -0400 Subject: [PATCH] Fix timing in the `AsyncRabbitTemplateTests` --- .../springframework/amqp/rabbit/AsyncRabbitTemplateTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/AsyncRabbitTemplateTests.java b/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/AsyncRabbitTemplateTests.java index 1c72c9db77..e054a7abab 100644 --- a/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/AsyncRabbitTemplateTests.java +++ b/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/AsyncRabbitTemplateTests.java @@ -473,7 +473,8 @@ private Message checkMessageResult(CompletableFuture future, String exp }); assertThat(cdl.await(10, TimeUnit.SECONDS)).isTrue(); assertThat(new String(resultRef.get().getBody())).isEqualTo(expected); - assertThat(TestUtils.getPropertyValue(future, "timeoutTask", Future.class).isCancelled()).isTrue(); + await().untilAsserted(() -> + assertThat(TestUtils.getPropertyValue(future, "timeoutTask", Future.class).isCancelled()).isTrue()); return resultRef.get(); }