This is an automated email from the ASF dual-hosted git repository.
rcordier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
The following commit(s) were added to refs/heads/master by this push:
new e48f8fcde7 [BUILD] RemoteDeliveryErrorHandlingTest was unstable
e48f8fcde7 is described below
commit e48f8fcde71cd0931cb2a45f30058a70348f45e7
Author: Benoit TELLIER <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]