This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch 3.7.x in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 7864143c5ee1d7c46e27502f0786b10bf4ca0095 Author: Quan Tran <hqt...@linagora.com> AuthorDate: Thu Aug 3 13:53:43 2023 +0700 JAMES-3924 QoS 1 for browser/content start update tests --- .../queue/rabbitmq/RabbitMQMailQueueTest.java | 38 +++++++++++++++------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/RabbitMQMailQueueTest.java b/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/RabbitMQMailQueueTest.java index 25623493b8..82f9a3176e 100644 --- a/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/RabbitMQMailQueueTest.java +++ b/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/RabbitMQMailQueueTest.java @@ -64,7 +64,6 @@ import org.apache.james.blob.cassandra.CassandraBlobStoreFactory; import org.apache.james.blob.mail.MimeMessageStore; import org.apache.james.core.builder.MimeMessageBuilder; import org.apache.james.eventsourcing.eventstore.cassandra.CassandraEventStoreModule; -import org.apache.james.junit.categories.Unstable; import org.apache.james.lifecycle.api.LifecycleUtil; import org.apache.james.metrics.api.Gauge; import org.apache.james.metrics.tests.RecordingMetricFactory; @@ -93,7 +92,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.RepeatedTest; -import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.mockito.ArgumentCaptor; @@ -152,7 +150,8 @@ class RabbitMQMailQueueTest { .sizeMetricsEnabled(true) .build(), CassandraBlobStoreFactory.forTesting(cassandra.getConf(), new RecordingMetricFactory()) - .passthrough()); + .passthrough(), + MailQueueFactory.prefetchCount(3)); } @Override @@ -201,8 +200,15 @@ class RabbitMQMailQueueTest { } @RepeatedTest(50) - @Tag(Unstable.TAG) - void browseStartShouldBeUpdated(CassandraCluster cassandraCluster) { + void browseStartShouldBeUpdated(CassandraCluster cassandraCluster, MailQueueMetricExtension.MailQueueMetricTestSystem metricTestSystem) throws Exception { + setUp(cassandraCluster, metricTestSystem, + RabbitMQMailQueueConfiguration.builder() + .sizeMetricsEnabled(true) + .build(), + CassandraBlobStoreFactory.forTesting(cassandraCluster.getConf(), new RecordingMetricFactory()) + .passthrough(), + MailQueueFactory.prefetchCount(1)); + int emailCount = 250; StatementRecorder.Selector selector = preparedStatementStartingWith("UPDATE browsestart"); @@ -227,8 +233,15 @@ class RabbitMQMailQueueTest { } @RepeatedTest(50) - @Tag(Unstable.TAG) - void contentStartShouldBeUpdated(CassandraCluster cassandraCluster) { + void contentStartShouldBeUpdated(CassandraCluster cassandraCluster, MailQueueMetricExtension.MailQueueMetricTestSystem metricTestSystem) throws Exception { + setUp(cassandraCluster, metricTestSystem, + RabbitMQMailQueueConfiguration.builder() + .sizeMetricsEnabled(true) + .build(), + CassandraBlobStoreFactory.forTesting(cassandraCluster.getConf(), new RecordingMetricFactory()) + .passthrough(), + MailQueueFactory.prefetchCount(1)); + int emailCount = 250; StatementRecorder.Selector selector = preparedStatementStartingWith("UPDATE contentstart"); @@ -940,7 +953,8 @@ class RabbitMQMailQueueTest { .sizeMetricsEnabled(false) .build(), CassandraBlobStoreFactory.forTesting(cassandra.getConf(), new RecordingMetricFactory()) - .passthrough()); + .passthrough(), + MailQueueFactory.prefetchCount(3)); } @Test @@ -963,7 +977,8 @@ class RabbitMQMailQueueTest { .sizeMetricsEnabled(true) .build(), CassandraBlobStoreFactory.forTesting(cassandra.getConf(), new RecordingMetricFactory()) - .deduplication()); + .deduplication(), + MailQueueFactory.prefetchCount(3)); } @Test @@ -998,7 +1013,8 @@ class RabbitMQMailQueueTest { } } - private void setUp(CassandraCluster cassandra, MailQueueMetricExtension.MailQueueMetricTestSystem metricTestSystem, RabbitMQMailQueueConfiguration configuration, BlobStore blobStore) throws Exception { + private void setUp(CassandraCluster cassandra, MailQueueMetricExtension.MailQueueMetricTestSystem metricTestSystem, RabbitMQMailQueueConfiguration configuration, + BlobStore blobStore, MailQueueFactory.PrefetchCount prefetchCount) throws Exception { MimeMessageStore.Factory mimeMessageStoreFactory = MimeMessageStore.factory(blobStore); clock = new UpdatableTickingClock(IN_SLICE_1); @@ -1025,6 +1041,6 @@ class RabbitMQMailQueueTest { configuration); mqManagementApi = new RabbitMQMailQueueManagement(rabbitMQExtension.managementAPI()); mailQueueFactory = new RabbitMQMailQueueFactory(rabbitMQExtension.getSender(), mqManagementApi, factory, rabbitMQExtension.getRabbitMQ().getConfiguration()); - mailQueue = mailQueueFactory.createQueue(SPOOL, MailQueueFactory.prefetchCount(3)); + mailQueue = mailQueueFactory.createQueue(SPOOL, prefetchCount); } } --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org For additional commands, e-mail: notifications-h...@james.apache.org