You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by xy...@apache.org on 2023/03/24 14:00:31 UTC
[pulsar-client-cpp] branch main updated: [fix] Use unique topic name in ConsumerInterceptorsTest (#231)
This is an automated email from the ASF dual-hosted git repository.
xyz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-client-cpp.git
The following commit(s) were added to refs/heads/main by this push:
new 8167852 [fix] Use unique topic name in ConsumerInterceptorsTest (#231)
8167852 is described below
commit 8167852471e854a7b606a4c240e1fe76fb5ec222
Author: Zike Yang <zi...@apache.org>
AuthorDate: Fri Mar 24 22:00:23 2023 +0800
[fix] Use unique topic name in ConsumerInterceptorsTest (#231)
---
tests/InterceptorsTest.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/InterceptorsTest.cc b/tests/InterceptorsTest.cc
index 42e2b19..bfd1e88 100644
--- a/tests/InterceptorsTest.cc
+++ b/tests/InterceptorsTest.cc
@@ -21,6 +21,7 @@
#include <pulsar/ConsumerInterceptor.h>
#include <pulsar/ProducerInterceptor.h>
+#include <random>
#include <utility>
#include "HttpHelper.h"
@@ -32,6 +33,8 @@ DECLARE_LOG_OBJECT()
static const std::string serviceUrl = "pulsar://localhost:6650";
static const std::string adminUrl = "http://localhost:8080/";
+extern std::string unique_str();
+
using namespace pulsar;
class ProducerTestInterceptor : public ProducerInterceptor {
@@ -272,8 +275,7 @@ class ConsumerTestInterceptor : public ConsumerInterceptor {
class ConsumerInterceptorsTest : public ::testing::TestWithParam<std::tuple<TopicType, int>> {
public:
void SetUp() override {
- topic_ = "persistent://public/default/InterceptorsTest-ConsumerInterceptors-" +
- std::to_string(time(nullptr));
+ topic_ = "persistent://public/default/InterceptorsTest-ConsumerInterceptors-" + unique_str();
switch (std::get<0>(GetParam())) {
case Partitioned: