Skip to content

Commit

Permalink
Use nano as topic suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
Demogorgon314 committed Aug 27, 2022
1 parent f8eeb41 commit 7aa0caa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pulsar-client-cpp/tests/ConsumerTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -808,14 +808,17 @@ class ConsumerSeekTest : public ::testing::TestWithParam<bool> {

TEST_P(ConsumerSeekTest, testSeekForMessageId) {
Client client(lookupUrl);
const std::string topic = "test-seek-for-message-id-" + std::to_string(time(nullptr));
auto n = std::chrono::system_clock::now();
auto now = std::chrono::duration_cast<std::chrono::nanoseconds>(n.time_since_epoch());

const std::string topic = "test-seek-for-message-id-" + std::to_string(now.count());

Producer producer;
ASSERT_EQ(ResultOk, client.createProducer(topic, producerConf_, producer));

const auto numMessages = 100;
MessageId seekMessageId;
srand(time(nullptr));

int r = (rand() % (numMessages - 1));
for (int i = 0; i < numMessages; i++) {
MessageId id;
Expand Down

0 comments on commit 7aa0caa

Please sign in to comment.