From dd54e66fabd219ac5b5530fd2215f435e752da7a Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Mon, 5 Nov 2012 15:48:37 -0500 Subject: [PATCH] AMQP-275 Reduce StopStart Test Size Reduce number of messages Reduce concurrency and prefetch Increase stop/start frequency --- .../springframework/amqp/rabbit/connection/RabbitUtils.java | 2 +- .../amqp/rabbit/listener/StopStartIntegrationTests.java | 4 ++-- .../rabbit/listener/StopStartIntegrationTests-context.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/RabbitUtils.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/RabbitUtils.java index dafbcc23..0309f657 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/RabbitUtils.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/RabbitUtils.java @@ -163,7 +163,7 @@ public abstract class RabbitUtils { /** * Gets and removes a ThreadLocal indicating the channel MUST be physically closed. - * @return + * @return true if the channel must be physically closed */ public static boolean isPhysicalCloseRequired() { Boolean mustClose = physicalCloseRequired.get(); diff --git a/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/listener/StopStartIntegrationTests.java b/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/listener/StopStartIntegrationTests.java index 05e27dea..8fdfe5ec 100644 --- a/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/listener/StopStartIntegrationTests.java +++ b/spring-rabbit/src/test/java/org/springframework/amqp/rabbit/listener/StopStartIntegrationTests.java @@ -45,7 +45,7 @@ public class StopStartIntegrationTests { private static AtomicInteger deliveries = new AtomicInteger(); - private static int COUNT = 300000; + private static int COUNT = 10000; @Autowired private ApplicationContext ctx; @@ -66,7 +66,7 @@ public class StopStartIntegrationTests { int n; int lastN = 0; while ((n = deliveries.get()) < COUNT) { - Thread.sleep(5000); + Thread.sleep(2000); container.stop(); container.start(); if (System.currentTimeMillis() - t > 240000 && lastN == n) { diff --git a/spring-rabbit/src/test/resources/org/springframework/amqp/rabbit/listener/StopStartIntegrationTests-context.xml b/spring-rabbit/src/test/resources/org/springframework/amqp/rabbit/listener/StopStartIntegrationTests-context.xml index 03c4dbb7..a8e89b9d 100644 --- a/spring-rabbit/src/test/resources/org/springframework/amqp/rabbit/listener/StopStartIntegrationTests-context.xml +++ b/spring-rabbit/src/test/resources/org/springframework/amqp/rabbit/listener/StopStartIntegrationTests-context.xml @@ -20,7 +20,7 @@ - +