nodece commented on code in PR #518:
URL: https://github.com/apache/pulsar-client-cpp/pull/518#discussion_r2493493691
##########
tests/ConsumerTest.cc:
##########
@@ -1573,4 +1573,19 @@ TEST(ConsumerTest,
testConsumerListenerShouldNotSegfaultAfterClose) {
ASSERT_EQ(ResultOk, client.close());
}
+TEST(ConsumerTest, testCloseAfterSeek) {
+ const auto topic = "test-close-after-seek-" +
std::to_string(time(nullptr));
+ const auto subscription = "sub";
+ Client client(lookupUrl);
+ Consumer consumer;
+ ASSERT_EQ(ResultOk, client.subscribe(topic, subscription, consumer));
+ ASSERT_EQ(ResultOk, consumer.seek(TimeUtils::currentTimeMillis()));
+ consumer.closeAsync(nullptr);
+
+ // Test the previous consumer will be closed even after seek is done, at
the moment the connection might
+ // not be established.
+ ASSERT_EQ(ResultOk, client.subscribe(topic, subscription, consumer));
+ client.close();
+}
Review Comment:
@BewareMyPower Add more test cases by creating a new client and a consumer
subscribing to the `topic` with the `sub` subscription in the test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]