merlimat closed pull request #1581: Fix for C++ test 
BasicEndToEndTest.testStatsLatencies
URL: https://github.com/apache/incubator-pulsar/pull/1581
 
 
   

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 dfbf44ed3..b87be2c9e 100644
--- a/pulsar-client-cpp/tests/BasicEndToEndTest.cc
+++ b/pulsar-client-cpp/tests/BasicEndToEndTest.cc
@@ -915,17 +915,11 @@ TEST(BasicEndToEndTest, testStatsLatencies) {
     // Start Producer and Consumer
     int numOfMessages = 1000;
 
-    Promise<Result, Producer> producerPromise;
-    client.createProducerAsync(topicName, 
WaitForCallbackValue<Producer>(producerPromise));
-    Future<Result, Producer> producerFuture = producerPromise.getFuture();
-    Result result = producerFuture.get(producer);
+    Result result = client.createProducer(topicName, producer);
     ASSERT_EQ(ResultOk, result);
 
     Consumer consumer;
-    Promise<Result, Consumer> consumerPromise;
-    client.subscribeAsync(topicName, subName, 
WaitForCallbackValue<Consumer>(consumerPromise));
-    Future<Result, Consumer> consumerFuture = consumerPromise.getFuture();
-    result = consumerFuture.get(consumer);
+    result = client.subscribe(topicName, subName, consumer);
     ASSERT_EQ(ResultOk, result);
 
     // handling dangling subscriptions
@@ -948,7 +942,7 @@ TEST(BasicEndToEndTest, testStatsLatencies) {
                           .setContent(messageContent)
                           .setProperty("msgIndex", 
boost::lexical_cast<std::string>(i))
                           .build();
-        producer.sendAsync(msg, boost::bind(&sendCallBack, _1, _2, prefix, 15, 
20 * 1e3));
+        producer.sendAsync(msg, boost::bind(&sendCallBack, _1, _2, prefix, 15, 
2 * 1e3));
         LOG_DEBUG("sending message " << messageContent);
     }
 
@@ -973,13 +967,13 @@ TEST(BasicEndToEndTest, testStatsLatencies) {
     ASSERT_EQ((uint64_t)latencies[2], (uint64_t)totalLatencies[2]);
     ASSERT_EQ((uint64_t)latencies[3], (uint64_t)totalLatencies[3]);
 
-    ASSERT_GE((uint64_t)latencies[1], 20 * 1000);
-    ASSERT_GE((uint64_t)latencies[2], 20 * 1000);
-    ASSERT_GE((uint64_t)latencies[3], 20 * 1000);
+    ASSERT_GE((uint64_t)latencies[1], 20 * 100);
+    ASSERT_GE((uint64_t)latencies[2], 20 * 100);
+    ASSERT_GE((uint64_t)latencies[3], 20 * 100);
 
-    ASSERT_GE((uint64_t)totalLatencies[1], 20 * 1000);
-    ASSERT_GE((uint64_t)totalLatencies[2], 20 * 1000);
-    ASSERT_GE((uint64_t)totalLatencies[3], 20 * 1000);
+    ASSERT_GE((uint64_t)totalLatencies[1], 20 * 100);
+    ASSERT_GE((uint64_t)totalLatencies[2], 20 * 100);
+    ASSERT_GE((uint64_t)totalLatencies[3], 20 * 100);
 
     while (producerStatsImplPtr->getNumMsgsSent() != 0) {
         usleep(1e6);  // wait till stats flush


 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to