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/JAMES-1746
Commit: e2b52479e7470754536cacaa51f9b8de2922663c
Parents: 728b037
Author: Benoit Tellier <btell...@linagora.com>
Authored: Tue Jun 7 15:57:12 2016 +0700
Committer: Benoit Tellier <btell...@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-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to