Fix Another Test Race Condition

https://build.spring.io/browse/AMQP-MEIGHT-910/
This commit is contained in:
Gary Russell
2016-12-05 10:01:27 -05:00
parent 6843903a67
commit 2c0844ae2a

View File

@@ -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));
}