james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [11/11] james-project git commit: JAMES-1746 Stress tests should not enforce monotony but unicity
Date Wed, 08 Jun 2016 11:36:09 GMT
JAMES-1746 Stress tests should not enforce monotony but unicity

Monotony can not be guarantied without transactions


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

Branch: refs/heads/master
Commit: e2b52479e7470754536cacaa51f9b8de2922663c
Parents: 728b037
Author: Benoit Tellier <btellier@linagora.com>
Authored: Tue Jun 7 15:57:12 2016 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Wed Jun 8 17:09:33 2016 +0700

----------------------------------------------------------------------
 .../james/mailbox/MailboxManagerStressTest.java      | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/e2b52479/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerStressTest.java
----------------------------------------------------------------------
diff --git a/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerStressTest.java
b/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerStressTest.java
index 6f7986a..b6dca58 100644
--- a/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerStressTest.java
+++ b/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerStressTest.java
@@ -137,16 +137,11 @@ public class MailboxManagerStressTest<T extends MailboxManager>
{
 
         latch.await();
 
-        // check if the uids were higher on each append. See MAILBOX-131
-        long last = 0;
-        for (Long uid : uList) {
-            if (uid <= last) {
-                fail(uid + "->" + last);
-            } else {
-                last = uid;
-            }
-
-        }
+        // check if there is no duplicates
+        // For mailboxes without locks, even if the UID is monotic, as re-scheduling can
happen between UID generation and event delivery,
+        // we can not check the order on the event listener
+        // No UID duplicates prevents message loss
+        assertEquals(APPEND_OPERATIONS, ImmutableSet.copyOf(uList).size());
         assertFalse("Unable to append all messages", fail.get());
         pool.shutdown();
     }


---------------------------------------------------------------------
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