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

btellier pushed a commit to branch build-stability-27-02-20204
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 95b736e7825311e128e42818e41129e8268aa8c2
Author: Benoit TELLIER <btell...@linagora.com>
AuthorDate: Tue Feb 27 22:31:29 2024 +0100

    [BUILD] RemoteDeliveryErrorHandlingTest was unstable
    
    As we did not await task execution the seond mail repository
    reprocessing could be triggered while the first one was not
    even started which would go undetected.
    
    Strictier awaits does the trick
---
 .../mailets/RemoteDeliveryErrorHandlingTest.java   | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git 
a/server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorHandlingTest.java
 
b/server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorHandlingTest.java
index 96aab51829..10ef0704a6 100644
--- 
a/server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorHandlingTest.java
+++ 
b/server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorHandlingTest.java
@@ -249,22 +249,36 @@ class RemoteDeliveryErrorHandlingTest {
                 .isEqualTo(1));
 
         // When we retry and temporary problem is not solved
-        given()
+        Object taskId = given()
             .spec(webAdminApi)
             .param("action", "reprocess")
             .param("queue", MailQueueFactory.SPOOL.asString())
             .param("processor", TRANSPORT_PROCESSOR)
-            .patch("/mailRepositories/" + 
REMOTE_DELIVERY_TEMPORARY_ERROR_REPOSITORY.getPath().urlEncoded() + "/mails");
+            .patch("/mailRepositories/" + 
REMOTE_DELIVERY_TEMPORARY_ERROR_REPOSITORY.getPath().urlEncoded() + "/mails")
+            .body()
+            .jsonPath()
+            .get("taskId");
+
+        given()
+            .spec(webAdminApi)
+            .get("/tests/" + taskId + "/await");
+
         awaitAtMostOneMinute
             .untilAsserted(() -> 
assertThat(jamesServer.getProbe(MailRepositoryProbeImpl.class)
                 
.getRepositoryMailCount(REMOTE_DELIVERY_TEMPORARY_ERROR_REPOSITORY))
                 .isEqualTo(1));
-        given()
+        Object taskId2 = given()
             .spec(webAdminApi)
             .param("action", "reprocess")
             .param("queue", MailQueueFactory.SPOOL.asString())
             .param("processor", TRANSPORT_PROCESSOR)
-            .patch("/mailRepositories/" + 
REMOTE_DELIVERY_TEMPORARY_ERROR_REPOSITORY.getPath().urlEncoded() + "/mails");
+            .patch("/mailRepositories/" + 
REMOTE_DELIVERY_TEMPORARY_ERROR_REPOSITORY.getPath().urlEncoded() + "/mails")
+            .body()
+            .jsonPath()
+            .get("taskId");
+        given()
+            .spec(webAdminApi)
+            .get("/tests/" + taskId2 + "/await");
 
         // Then mail should be stored in permanent error repository
         awaitAtMostOneMinute


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

Reply via email to