diff --git a/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitTemplateIntegrationTests.java b/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitTemplateIntegrationTests.java index 12863b04..05309c8a 100644 --- a/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitTemplateIntegrationTests.java +++ b/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/core/RabbitTemplateIntegrationTests.java @@ -301,7 +301,12 @@ public class RabbitTemplateIntegrationTests { String out = (String) this.template.receiveAndConvert(ROUTE, -1); assertNotNull(out); assertEquals("blockNoTO", out); - this.template.setReceiveTimeout(1); // test the no message after timeout path + try { + this.template.setReceiveTimeout(1); // test the no message after timeout path + } + catch (ConsumeOkNotReceivedException e) { + // we're expecting no result, this could happen, depending on timing. + } assertNull(this.template.receive(ROUTE)); }