question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flaky-test: C++ ClientTest.testReferenceCount

See original GitHub issue

ClientTest.testReferenceCount is flaky. It fails sporadically.

example failure

2022-03-23 08:18:48.488 INFO  [140121845906176] ClientConnection:182 | [<none> -> pulsar://localhost:6650] Create ClientConnection, timeout=10000
2022-03-23 08:18:48.488 INFO  [140121845906176] ConnectionPool:96 | Created connection for pulsar://localhost:6650
2022-03-23 08:18:48.492 INFO  [140121726842624] ClientConnection:368 | [127.0.0.1:32784 -> 127.0.0.1:6650] Connected to broker
2022-03-23 08:18:48.494 INFO  [140121726842624] HandlerBase:64 | [persistent://public/default/client-test-reference-count-1648023528, ] Getting connection from pool
2022-03-23 08:18:48.504 INFO  [140121726842624] ProducerImpl:188 | [persistent://public/default/client-test-reference-count-1648023528, ] Created producer on broker [127.0.0.1:32784 -> 127.0.0.1:6650]
/pulsar/pulsar-client-cpp/tests/ClientTest.cc:[192](https://github.com/apache/pulsar/runs/5656553451?check_suite_focus=true#step:11:192): Failure
Value of: 1
Expected: producers[0].use_count()
Which is: 7
2022-03-23 08:18:48.525 INFO  [140385848068864] ClientConnection:182 | [<none> -> pulsar://localhost:6650] Create ClientConnection, timeout=10000
2022-03-23 08:18:48.525 INFO  [140385848068864] ConnectionPool:96 | Created connection for pulsar://localhost:6650
2022-03-23 08:18:48.527 INFO  [140385729005312] ClientConnection:368 | [127.0.0.1:32786 -> 127.0.0.1:6650] Connected to broker
2022-03-23 08:18:48.530 INFO  [140385729005312] HandlerBase:64 | [persistent://public/default/client-test-reference-count-1648023528, ] Getting connection from pool
2022-03-23 08:18:48.536 INFO  [140385729005312] ProducerImpl:188 | [persistent://public/default/client-test-reference-count-1648023528, ] Created producer on broker [127.0.0.1:32786 -> 127.0.0.1:6650]
/pulsar/pulsar-client-cpp/tests/ClientTest.cc:192: Failure
Value of: 1
Expected: producers[0].use_count()
Which is: 7

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
codelipenghuicommented, Aug 22, 2022
0reactions
BewareMyPowercommented, Sep 14, 2022

Steps to reproduce

First, start a container:

mvn clean install -DskipTests -Pcore-modules,-main
docker run -v $PWD:/pulsar -it apachepulsar/pulsar-build:ubuntu-20.04 /bin/bash

Then, run the following commands inside the container:

# Build the unit test (increase the docker memory if segfault happened, or remove -j4 option)
cd /pulsar/pulsar-client-cpp/
cmake -B _builds -DBUILD_DYNAMIC_LIB=OFF -DBUILD_PERF_TOOLS=OFF -DBUILD_PYTHON_WRAPPER=OFF
cmake --build _builds -j4

# Run the standalone
cd /pulsar/distribution/server/target/
tar zxf apache-pulsar-*.tar.gz
cd apache-pulsar-*-SNAPSHOT
./bin/pulsar-daemon start standalone -nss -nfw

# Run the test for multiple times
cd /pulsar/pulsar-client-cpp/_builds
./tests/main --gtest_filter='ClientTest.testReferenceCount' --gtest_repeat=10
Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found