This is an automated email from the ASF dual-hosted git repository. matthieu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit dbefe42325b3a6e7487a708441ec4a4a4218ed67 Author: Rémi KOWALSKI <rkowal...@linagora.com> AuthorDate: Wed Jan 15 11:02:34 2020 +0100 JAMES-3028 reduce number of operation in concurrent tests --- .../james/blob/api/DeleteDumbBlobStoreContract.java | 2 +- .../james/blob/api/ReadSaveDumbBlobStoreContract.java | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/server/blob/blob-api/src/test/java/org/apache/james/blob/api/DeleteDumbBlobStoreContract.java b/server/blob/blob-api/src/test/java/org/apache/james/blob/api/DeleteDumbBlobStoreContract.java index afd8f0e..a391b90 100644 --- a/server/blob/blob-api/src/test/java/org/apache/james/blob/api/DeleteDumbBlobStoreContract.java +++ b/server/blob/blob-api/src/test/java/org/apache/james/blob/api/DeleteDumbBlobStoreContract.java @@ -207,7 +207,7 @@ public interface DeleteDumbBlobStoreContract { (thread, iteration) -> checkConcurrentMixedOperation() ) .threadCount(10) - .operationCount(100) + .operationCount(10) .runSuccessfullyWithin(Duration.ofMinutes(2)); } diff --git a/server/blob/blob-api/src/test/java/org/apache/james/blob/api/ReadSaveDumbBlobStoreContract.java b/server/blob/blob-api/src/test/java/org/apache/james/blob/api/ReadSaveDumbBlobStoreContract.java index 0aa55a9..8a17f5b 100644 --- a/server/blob/blob-api/src/test/java/org/apache/james/blob/api/ReadSaveDumbBlobStoreContract.java +++ b/server/blob/blob-api/src/test/java/org/apache/james/blob/api/ReadSaveDumbBlobStoreContract.java @@ -35,6 +35,7 @@ import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.time.Duration; +import java.util.Arrays; import java.util.concurrent.ExecutionException; import java.util.stream.Stream; @@ -323,8 +324,8 @@ public interface ReadSaveDumbBlobStoreContract { (threadNumber, step) -> checkConcurrentSaveOperation(bytes) ) .threadCount(10) - .operationCount(100) - .runSuccessfullyWithin(Duration.ofMinutes(2)); + .operationCount(20) + .runSuccessfullyWithin(Duration.ofMinutes(10)); } @ParameterizedTest(name = "[{index}] {0}") @@ -337,7 +338,7 @@ public interface ReadSaveDumbBlobStoreContract { (threadNumber, step) -> checkConcurrentSaveOperation(bytes) ) .threadCount(10) - .operationCount(100) + .operationCount(20) .runSuccessfullyWithin(Duration.ofMinutes(2)); } @@ -351,14 +352,14 @@ public interface ReadSaveDumbBlobStoreContract { (threadNumber, step) -> checkConcurrentSaveOperation(bytes) ) .threadCount(10) - .operationCount(100) + .operationCount(20) .runSuccessfullyWithin(Duration.ofMinutes(2)); } default Mono<Void> checkConcurrentSaveOperation(byte[] expected) { - return Mono - .fromCallable(() -> - testee().readBytes(TEST_BUCKET_NAME, TEST_BLOB_ID).block()) + return testee().readBytes(TEST_BUCKET_NAME, TEST_BLOB_ID) + //assertj is very cpu-intensive, let's compute the assertion only when arrays are different + .filter(bytes -> !Arrays.equals(bytes, expected)) .doOnNext(bytes -> assertThat(bytes).isEqualTo(expected)) .then(); } --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org