From 2c0844ae2a19771e16fdb518cbdd7428cbe92362 Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Mon, 5 Dec 2016 10:01:27 -0500 Subject: [PATCH] Fix Another Test Race Condition https://build.spring.io/browse/AMQP-MEIGHT-910/ --- .../amqp/rabbit/core/RabbitTemplateIntegrationTests.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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)); }