james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [03/10] james-project git commit: JAMES-2334 Relax rabbitmq docker wait strategy
Date Wed, 24 Oct 2018 01:51:29 GMT
JAMES-2334 Relax rabbitmq docker wait strategy


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/b1035f3e
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/b1035f3e
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/b1035f3e

Branch: refs/heads/master
Commit: b1035f3e3d47005f39bb105792b04841286192c2
Parents: 9dcc899
Author: duc <dtran@linagora.com>
Authored: Fri Oct 19 14:25:57 2018 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Wed Oct 24 08:48:13 2018 +0700

----------------------------------------------------------------------
 .../java/org/apache/james/backend/rabbitmq/DockerRabbitMQ.java  | 5 +++--
 .../main/java/org/apache/james/util/docker/RateLimiters.java    | 5 +++++
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/b1035f3e/backends-common/rabbitmq/src/test/java/org/apache/james/backend/rabbitmq/DockerRabbitMQ.java
----------------------------------------------------------------------
diff --git a/backends-common/rabbitmq/src/test/java/org/apache/james/backend/rabbitmq/DockerRabbitMQ.java
b/backends-common/rabbitmq/src/test/java/org/apache/james/backend/rabbitmq/DockerRabbitMQ.java
index 29add81..e88c74d 100644
--- a/backends-common/rabbitmq/src/test/java/org/apache/james/backend/rabbitmq/DockerRabbitMQ.java
+++ b/backends-common/rabbitmq/src/test/java/org/apache/james/backend/rabbitmq/DockerRabbitMQ.java
@@ -20,6 +20,7 @@ package org.apache.james.backend.rabbitmq;
 
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.time.Duration;
 import java.util.Optional;
 import java.util.UUID;
 
@@ -79,8 +80,8 @@ public class DockerRabbitMQ {
 
     private WaitAllStrategy waitStrategy() {
         return new WaitAllStrategy()
-            .withStrategy(Wait.forHttp("").forPort(DEFAULT_RABBITMQ_ADMIN_PORT).withRateLimiter(RateLimiters.DEFAULT))
-            .withStrategy(RabbitMQWaitStrategy.withDefaultTimeout(this));
+            .withStrategy(Wait.forHttp("").forPort(DEFAULT_RABBITMQ_ADMIN_PORT).withRateLimiter(RateLimiters.TWENTIES_PER_MINUTE))
+            .withStrategy(new RabbitMQWaitStrategy(this, Duration.ofMinutes(10)));
     }
 
     private String randomName() {

http://git-wip-us.apache.org/repos/asf/james-project/blob/b1035f3e/server/testing/src/main/java/org/apache/james/util/docker/RateLimiters.java
----------------------------------------------------------------------
diff --git a/server/testing/src/main/java/org/apache/james/util/docker/RateLimiters.java b/server/testing/src/main/java/org/apache/james/util/docker/RateLimiters.java
index d75730e..de92ba1 100644
--- a/server/testing/src/main/java/org/apache/james/util/docker/RateLimiters.java
+++ b/server/testing/src/main/java/org/apache/james/util/docker/RateLimiters.java
@@ -29,4 +29,9 @@ public interface RateLimiters {
         .withRate(20, TimeUnit.SECONDS)
         .withConstantThroughput()
         .build();
+
+    RateLimiter TWENTIES_PER_MINUTE = RateLimiterBuilder.newBuilder()
+        .withRate(20, TimeUnit.MINUTES)
+        .withConstantThroughput()
+        .build();
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message