This is an automated email from the ASF dual-hosted git repository. mmerli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git
The following commit(s) were added to refs/heads/master by this push: new d8af136 Fix for C++ test BasicEndToEndTest.testStatsLatencies (#1581) d8af136 is described below commit d8af1369c837378cdf46f1132bee108dede94cdc Author: Matteo Merli <mme...@apache.org> AuthorDate: Sun Apr 15 18:27:26 2018 -0700 Fix for C++ test BasicEndToEndTest.testStatsLatencies (#1581) * Fix fot C++ test BasicEndToEndTest.testStatsLatencies * Removed unwanted change in standalone conf --- pulsar-client-cpp/tests/BasicEndToEndTest.cc | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/pulsar-client-cpp/tests/BasicEndToEndTest.cc b/pulsar-client-cpp/tests/BasicEndToEndTest.cc index f89096c..56c1796 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 -- To stop receiving notification emails like this one, please contact mme...@apache.org.