You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/09/25 06:03:19 UTC

[GitHub] sijie closed pull request #2643: [tests] improve DispatcherBlockConsumerTest#testBrokerSubscriptionRecovery

sijie closed pull request #2643: [tests] improve DispatcherBlockConsumerTest#testBrokerSubscriptionRecovery
URL: https://github.com/apache/pulsar/pull/2643
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/DispatcherBlockConsumerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/DispatcherBlockConsumerTest.java
index d8f0cf7d0b..727ce6266e 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/DispatcherBlockConsumerTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/DispatcherBlockConsumerTest.java
@@ -647,8 +647,10 @@ public void testBrokerSubscriptionRecovery(boolean unloadBundleGracefully) throw
             }
             receivedMsgs.add(new String(msg.getData()));
         }
-        receivedMsgs.removeAll(unackMsgs);
-        assertTrue(receivedMsgs.isEmpty());
+        // there is no guarantee when a messages is acknowledged when consumer.acknowledge is called.
+        // consumer.acknowledge only guarantees that an ack request is sent to the wire. so we can
+        // only check all unackMsgs will be redelivered.
+        unackMsgs.forEach(msg -> assertTrue(receivedMsgs.contains(msg)));
     }
 
     /**


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services