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 2019/01/22 02:20:47 UTC

[8/8] james-project git commit: MAILBOX-369 Isolate concurrent tests to a nested class

MAILBOX-369 Isolate concurrent tests to a nested class

Therefore they could not affect to other tests cases because concurrent
tests are running on another docker rabbitmq. Experiments show that
concurrent tests implicitly impact to other tests correctness, because they
fire a lot of events without consuming them, then later, other tests starting
consume events are fired from concurrent tests, and make assertions fail

To ensure docker rabbitmq is cleaned up after each test are quite difficult
to archive because some queues, exchanges are durable, even start & stop
docker doesn't make them abandon there messages. This could be considered as
a workaround for this issue. Creating new docker and start it in every test
is expensive and leads to minutes to finish this test class.


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

Branch: refs/heads/master
Commit: 97555fe928ac04d71521233bf2fac28a0292ab2f
Parents: 485dd95
Author: tran tien duc <dt...@linagora.com>
Authored: Mon Jan 21 10:36:09 2019 +0700
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Tue Jan 22 09:20:12 2019 +0700

----------------------------------------------------------------------
 .../mailbox/events/RabbitMQEventBusTest.java    | 26 +++++++++++++++-----
 1 file changed, 20 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/97555fe9/mailbox/event/event-rabbitmq/src/test/java/org/apache/james/mailbox/events/RabbitMQEventBusTest.java
----------------------------------------------------------------------
diff --git a/mailbox/event/event-rabbitmq/src/test/java/org/apache/james/mailbox/events/RabbitMQEventBusTest.java b/mailbox/event/event-rabbitmq/src/test/java/org/apache/james/mailbox/events/RabbitMQEventBusTest.java
index b6f811d..910b83e 100644
--- a/mailbox/event/event-rabbitmq/src/test/java/org/apache/james/mailbox/events/RabbitMQEventBusTest.java
+++ b/mailbox/event/event-rabbitmq/src/test/java/org/apache/james/mailbox/events/RabbitMQEventBusTest.java
@@ -77,7 +77,6 @@ import reactor.rabbitmq.Sender;
 import reactor.rabbitmq.SenderOptions;
 
 class RabbitMQEventBusTest implements GroupContract.SingleEventBusGroupContract, GroupContract.MultipleEventBusGroupContract,
-    EventBusConcurrentTestContract.MultiEventBusConcurrentContract, EventBusConcurrentTestContract.SingleEventBusConcurrentContract,
     KeyContract.SingleEventBusKeyContract, KeyContract.MultipleEventBusKeyContract,
     ErrorHandlingContract {
 
@@ -138,11 +137,6 @@ class RabbitMQEventBusTest implements GroupContract.SingleEventBusGroupContract,
     }
 
     @Override
-    public EventBus eventBus3() {
-        return eventBus3;
-    }
-
-    @Override
     @Test
     @Disabled("This test is failing by RabbitMQEventBus exponential backoff is not implemented at this time")
     public void failingRegisteredListenersShouldNotAbortRegisteredDelivery() {
@@ -168,6 +162,26 @@ class RabbitMQEventBusTest implements GroupContract.SingleEventBusGroupContract,
     }
 
     @Nested
+    class ConcurrentTest implements EventBusConcurrentTestContract.MultiEventBusConcurrentContract,
+        EventBusConcurrentTestContract.SingleEventBusConcurrentContract {
+
+        @Override
+        public EventBus eventBus3() {
+            return eventBus3;
+        }
+
+        @Override
+        public EventBus eventBus2() {
+            return eventBus2;
+        }
+
+        @Override
+        public EventBus eventBus() {
+            return eventBus;
+        }
+    }
+
+    @Nested
     class AtLeastOnceTest {
 
         @Test


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