You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2020/04/23 08:39:38 UTC

[james-project] 01/02: JAMES-3142 Fasten RabbitMQEventDeadLettersIntegrationTest

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 5c5010cdfabefa5da62f3f034e10dae79d19d211
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Apr 20 09:46:33 2020 +0700

    JAMES-3142 Fasten RabbitMQEventDeadLettersIntegrationTest
    
    From 14 minutes to 1 minute 40 seconds
    
    Reduce the number of retries to fasten testing
---
 .../RabbitMQEventDeadLettersIntegrationTest.java        | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQEventDeadLettersIntegrationTest.java b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQEventDeadLettersIntegrationTest.java
index b8cbbd0..671be90 100644
--- a/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQEventDeadLettersIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQEventDeadLettersIntegrationTest.java
@@ -51,6 +51,7 @@ import org.apache.james.mailbox.events.Event;
 import org.apache.james.mailbox.events.EventDispatcher.DispatchingFailureGroup;
 import org.apache.james.mailbox.events.Group;
 import org.apache.james.mailbox.events.MailboxListener;
+import org.apache.james.mailbox.events.RetryBackoffConfiguration;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.modules.AwsS3BlobStoreExtension;
@@ -191,6 +192,10 @@ class RabbitMQEventDeadLettersIntegrationTest {
         }
     }
 
+    //This value is duplicated from default configuration to ensure we keep the same behavior over time
+    //unless we really want to change that default value
+    private static final int MAX_RETRIES = 2;
+
     private static RabbitMQExtension RABBIT_MQ_EXTENSION = new RabbitMQExtension();
     @RegisterExtension
     static JamesServerExtension testExtension = new JamesServerBuilder()
@@ -201,13 +206,15 @@ class RabbitMQEventDeadLettersIntegrationTest {
         .extension(new RetryEventsListenerExtension())
         .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
             .combineWith(CassandraRabbitMQJamesServerMain.MODULES)
-            .overrideWith(new WebadminIntegrationTestModule()))
+            .overrideWith(new WebadminIntegrationTestModule())
+            .overrideWith(binder -> binder.bind(RetryBackoffConfiguration.class)
+                .toInstance(RetryBackoffConfiguration.builder()
+                    .maxRetries(MAX_RETRIES)
+                    .firstBackoff(java.time.Duration.ofMillis(100))
+                    .jitterFactor(0.5)
+                    .build())))
         .build();
 
-    //This value is duplicated from default configuration to ensure we keep the same behavior over time
-    //unless we really want to change that default value
-    private static final int MAX_RETRIES = 8;
-
     private static final String DOMAIN = "domain.tld";
     private static final String BOB = "bob@" + DOMAIN;
     private static final String BOB_PASSWORD = "bobPassword";


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