You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "quantranhong1999 (via GitHub)" <gi...@apache.org> on 2023/08/03 06:55:09 UTC

[GitHub] [james-project] quantranhong1999 commented on a diff in pull request #1623: JAMES-3924 RabbitMQ mail queue updates: not performed

quantranhong1999 commented on code in PR #1623:
URL: https://github.com/apache/james-project/pull/1623#discussion_r1282731930


##########
server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/RabbitMQMailQueueTest.java:
##########
@@ -197,6 +202,55 @@ void browseShouldReturnCurrentlyEnqueuedMailFromAllSlices() throws Exception {
                 "5-1", "5-2", "5-3", "5-4", "5-5");
         }
 
+        @RepeatedTest(50)
+        void browseStartShouldBeUpdated(CassandraCluster cassandraCluster) {
+            int emailCount = 250;
+
+            StatementRecorder.Selector selector = preparedStatementStartingWith("UPDATE browsestart");
+            StatementRecorder statementRecorder = cassandraCluster.getConf()
+                .recordStatements(selector);
+
+            clock.setInstant(IN_SLICE_1);
+            enqueueSomeMails(namePatternForSlice(1), emailCount);
+            dequeueMails(emailCount);
+
+            clock.setInstant(IN_SLICE_2);
+            enqueueSomeMails(namePatternForSlice(2), emailCount);
+            dequeueMails(emailCount);
+
+            clock.setInstant(IN_SLICE_3);
+            enqueueSomeMails(namePatternForSlice(3), emailCount);
+            dequeueMails(emailCount);
+
+            // The actual rate of update should actually be lower than the update probability.
+            assertThat(statementRecorder.listExecutedStatements(selector))
+                .hasSizeBetween(2, 12);
+        }

Review Comment:
   Thank you for your suggestion. It indeed helps the tests to be more stable.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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