You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ro...@apache.org on 2019/10/07 10:00:12 UTC
[james-project] 01/02: JAMES-2908 Demonstrate JAMES-2907 issue and
disable broken tests
This is an automated email from the ASF dual-hosted git repository.
rouazana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit f817bb009760067353f44e67d05fba7710220eef
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Wed Oct 2 11:11:26 2019 +0200
JAMES-2908 Demonstrate JAMES-2907 issue and disable broken tests
---
.../mailbox/events/ErrorHandlingContract.java | 32 ++++++++++++++++++----
.../EventDeadLettersIntegrationTest.java | 2 ++
2 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/mailbox/api/src/test/java/org/apache/james/mailbox/events/ErrorHandlingContract.java b/mailbox/api/src/test/java/org/apache/james/mailbox/events/ErrorHandlingContract.java
index 6acba59..b950685 100644
--- a/mailbox/api/src/test/java/org/apache/james/mailbox/events/ErrorHandlingContract.java
+++ b/mailbox/api/src/test/java/org/apache/james/mailbox/events/ErrorHandlingContract.java
@@ -38,6 +38,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.james.mailbox.util.EventCollector;
import org.assertj.core.api.SoftAssertions;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import com.google.common.collect.ImmutableSet;
@@ -279,12 +280,31 @@ interface ErrorHandlingContract extends EventBusContract {
eventBus().register(eventCollector, GROUP_A);
eventBus().reDeliver(GROUP_A, EVENT).block();
- WAIT_CONDITION.untilAsserted(() -> assertThat(deadLetter().failedIds(GROUP_A)
- .flatMap(insertionId -> deadLetter().failedEvent(GROUP_A, insertionId))
- .toIterable())
- .containsOnly(EVENT));
- assertThat(eventCollector.getEvents())
- .isEmpty();
+ WAIT_CONDITION.untilAsserted(() ->
+ assertThat(
+ deadLetter()
+ .failedIds(GROUP_A)
+ .flatMap(insertionId -> deadLetter().failedEvent(GROUP_A, insertionId))
+ .toIterable())
+ .containsOnly(EVENT));
+ assertThat(eventCollector.getEvents()).isEmpty();
+ }
+
+ @Disabled("JAMES-2907 redeliver should work as initial dispatch")
+ @Test
+ default void retryShouldDeliverAsManyTimesAsInitialDeliveryAttempt() {
+ EventCollector eventCollector = eventCollector();
+
+ doThrow(new RuntimeException())
+ .doThrow(new RuntimeException())
+ .doThrow(new RuntimeException())
+ .doCallRealMethod()
+ .when(eventCollector).event(EVENT);
+
+ eventBus().register(eventCollector, GROUP_A);
+ eventBus().reDeliver(GROUP_A, EVENT).block();
+
+ WAIT_CONDITION.untilAsserted(() -> assertThat(eventCollector.getEvents()).isNotEmpty());
}
@Test
diff --git a/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/EventDeadLettersIntegrationTest.java b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/EventDeadLettersIntegrationTest.java
index 082e3d7..5af52b2 100644
--- a/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/EventDeadLettersIntegrationTest.java
+++ b/server/protocols/webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/EventDeadLettersIntegrationTest.java
@@ -55,6 +55,7 @@ import org.awaitility.core.ConditionFactory;
import org.eclipse.jetty.http.HttpStatus;
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
@@ -463,6 +464,7 @@ public class EventDeadLettersIntegrationTest {
awaitAtMostTenSeconds.until(() -> retryEventsListener.getSuccessfulEvents().size() == 2);
}
+ @Ignore("retry rest API delivers only once, see JAMES-2907. We need same retry cound for this test to work")
@Test
public void failedEventShouldStillBeInDeadLettersAfterFailedRedelivery() {
retryEventsListener.setRetriesBeforeSuccess(8);
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org