This is an automated email from the ASF dual-hosted git repository.

xyz pushed a commit to branch branch-2.9
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-2.9 by this push:
     new 06a0a7520bf [branch-2.9][C++] Fix broken testBacklogQuotasExceeded
06a0a7520bf is described below

commit 06a0a7520bfe2c55c8c322774c36fe9e87cc068e
Author: Yunze Xu <[email protected]>
AuthorDate: Wed Apr 20 12:17:02 2022 +0800

    [branch-2.9][C++] Fix broken testBacklogQuotasExceeded
    
    The C++ test  is broken, see
    https://github.com/apache/pulsar/pull/15220#issuecomment-1103441676 for 
details.
    
    It might be caused by a deadlock that was fixed by 
https://github.com/apache/pulsar/pull/13885.
    Since that PR has many dependencies, it cannot be cherry-picked into 
branch-2.9 currently.
    Therefore, apply some changes to the broken test as a workaround
---
 pulsar-client-cpp/tests/ProducerTest.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pulsar-client-cpp/tests/ProducerTest.cc 
b/pulsar-client-cpp/tests/ProducerTest.cc
index 14461429da3..258811fcdaf 100644
--- a/pulsar-client-cpp/tests/ProducerTest.cc
+++ b/pulsar-client-cpp/tests/ProducerTest.cc
@@ -269,6 +269,7 @@ TEST(ProducerTest, testBacklogQuotasExceeded) {
     ASSERT_EQ(ResultOk, client.createProducer(partition, producer));
     ASSERT_EQ(ResultOk, 
producer.send(MessageBuilder().setContent(std::string(1024L, 'a')).build()));
     ASSERT_EQ(ResultOk, producer.close());
+    ASSERT_EQ(ResultOk, consumer.close());
 
     setBacklogPolicy("producer_request_hold", 1024);
     ASSERT_EQ(ResultProducerBlockedQuotaExceededError, 
client.createProducer(topic, producer));
@@ -283,4 +284,4 @@ TEST(ProducerTest, testBacklogQuotasExceeded) {
     ASSERT_EQ(ResultOk, client.createProducer(partition, producer));
 
     client.close();
-}
\ No newline at end of file
+}

Reply via email to