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 bt...@apache.org on 2020/07/31 09:24:36 UTC

[james-project] 15/28: JAMES-3350 RabbitMQEventBusTest: replace a sleep by an await

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

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

commit 4f812554b1452561285a20af6b82317056bbd511
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Jul 27 15:06:20 2020 +0700

    JAMES-3350 RabbitMQEventBusTest: replace a sleep by an await
---
 .../java/org/apache/james/mailbox/events/ErrorHandlingContract.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 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 96642cb..18bcb18 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
@@ -169,13 +169,14 @@ interface ErrorHandlingContract extends EventBusContract {
     }
 
     @Test
-    default void retriesBackOffShouldDelayByExponentialGrowth() throws Exception {
+    default void retriesBackOffShouldDelayByExponentialGrowth() {
         ThrowingListener throwingListener = throwingListener();
 
         eventBus().register(throwingListener, GROUP_A);
         eventBus().dispatch(EVENT, NO_KEYS).block();
 
-        Thread.sleep(getSpeedProfile().getShortWaitTime().toMillis());
+        getSpeedProfile().shortWaitCondition()
+            .untilAsserted(() -> assertThat(throwingListener.executionCount()).isEqualTo(4));
         SoftAssertions.assertSoftly(softly -> {
             List<Instant> timeElapsed = throwingListener.timeElapsed;
             softly.assertThat(timeElapsed).hasSize(RETRY_BACKOFF_CONFIGURATION.getMaxRetries() + 1);


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org