sijie closed pull request #1936: Cpp client: fix flaky seek test
URL: https://github.com/apache/incubator-pulsar/pull/1936
 
 
   

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-client-cpp/tests/BasicEndToEndTest.cc 
b/pulsar-client-cpp/tests/BasicEndToEndTest.cc
index 47713e9b42..692e21fe5a 100644
--- a/pulsar-client-cpp/tests/BasicEndToEndTest.cc
+++ b/pulsar-client-cpp/tests/BasicEndToEndTest.cc
@@ -1381,6 +1381,9 @@ TEST(BasicEndToEndTest, testSeek) {
 
     // seek to earliest, expected receive first message.
     result = consumer.seek(MessageId::earliest());
+    // Sleeping for 500ms to wait for consumer re-connect
+    usleep(500 * 1000);
+
     ASSERT_EQ(ResultOk, result);
     consumer.receive(msgReceived, 100);
     LOG_ERROR("Received message :" << msgReceived.getMessageId());
@@ -1388,7 +1391,7 @@ TEST(BasicEndToEndTest, testSeek) {
     msgNum = 0;
     expected << msgContent << msgNum;
     ASSERT_EQ(expected.str(), msgReceived.getDataAsString());
-
+    ASSERT_EQ(ResultOk, consumer.acknowledge(msgReceived));
     ASSERT_EQ(ResultOk, consumer.unsubscribe());
     ASSERT_EQ(ResultAlreadyClosed, consumer.close());
     ASSERT_EQ(ResultOk, producer.close());


 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to