This is an automated email from the ASF dual-hosted git repository.

hqtran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 7b2fec42a4ac205f2daa1286242bff5336c55033
Author: Quan Tran <[email protected]>
AuthorDate: Thu Sep 18 13:41:23 2025 +0700

    [BUILD] [blob-postgres] PostgresBlobStoreDAOTest: reduce level of 
concurrency tests
    
    Postgres backed blob store is notably slow in the concurrency manner. We 
can reduce the concurrency level by half to save build time, while still can 
validate PostgresBlobStoreDAO handling concurrency well.
---
 .../blob/postgres/PostgresBlobStoreDAOTest.java    | 23 ++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git 
a/server/blob/blob-postgres/src/test/java/org/apache/james/blob/postgres/PostgresBlobStoreDAOTest.java
 
b/server/blob/blob-postgres/src/test/java/org/apache/james/blob/postgres/PostgresBlobStoreDAOTest.java
index 33c53c5a99..7399cfcfa3 100644
--- 
a/server/blob/blob-postgres/src/test/java/org/apache/james/blob/postgres/PostgresBlobStoreDAOTest.java
+++ 
b/server/blob/blob-postgres/src/test/java/org/apache/james/blob/postgres/PostgresBlobStoreDAOTest.java
@@ -74,8 +74,8 @@ class PostgresBlobStoreDAOTest implements 
BlobStoreDAOContract {
                 (threadNumber, step) -> testee().save(TEST_BUCKET_NAME, 
TEST_BLOB_ID, ByteSource.wrap(bytes)),
                 (threadNumber, step) -> checkConcurrentSaveOperation(bytes)
             )
-            .threadCount(10)
-            .operationCount(20)
+            .threadCount(5)
+            .operationCount(10)
             .runSuccessfullyWithin(CONCURRENT_TEST_DURATION);
     }
 
@@ -89,8 +89,23 @@ class PostgresBlobStoreDAOTest implements 
BlobStoreDAOContract {
                 (threadNumber, step) -> testee().save(TEST_BUCKET_NAME, 
TEST_BLOB_ID, new ByteArrayInputStream(bytes)),
                 (threadNumber, step) -> checkConcurrentSaveOperation(bytes)
             )
-            .threadCount(10)
-            .operationCount(20)
+            .threadCount(5)
+            .operationCount(10)
             .runSuccessfullyWithin(CONCURRENT_TEST_DURATION);
     }
+
+    @Override
+    @ParameterizedTest(name = "[{index}] {0}")
+    @MethodSource(value = "blobs")
+    public void concurrentSaveBytesShouldReturnConsistentValues(String 
description, byte[] bytes) throws ExecutionException, InterruptedException {
+        Mono.from(testee().save(TEST_BUCKET_NAME, TEST_BLOB_ID, 
bytes)).block();
+        ConcurrentTestRunner.builder()
+            .randomlyDistributedReactorOperations(
+                (threadNumber, step) -> testee().save(TEST_BUCKET_NAME, 
TEST_BLOB_ID, bytes),
+                (threadNumber, step) -> checkConcurrentSaveOperation(bytes)
+            )
+            .threadCount(5)
+            .operationCount(10)
+            .runSuccessfullyWithin(Duration.ofMinutes(10));
+    }
 }
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to