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++ ProducerTest.testSendAsyncCloseAsyncConcurrentlyWithLazyProducers

See original GitHub issue

ProducerTest.testSendAsyncCloseAsyncConcurrentlyWithLazyProducers fails sporadically.

example failure

2022-01-20 05:08:14.347 INFO  [139723758618368] ProducerTest:208 | Closing
2022-01-20 05:08:14.347 INFO  [139723758618368] ProducerImpl:621 | [persistent://public/default/testProducerIsConnectedPartitioned-1642655293-partition-7, standalone-0-401] Closing producer for topic persistent://public/default/testProducerIsConnectedPartitioned-1642655293-partition-7
2022-01-20 05:08:14.347 INFO  [139723758618368] ProducerTest:210 | Close called
2022-01-20 05:08:14.347 INFO  [139724043835136] ProducerImpl:664 | [persistent://public/default/testProducerIsConnectedPartitioned-1642655293-partition-7, standalone-0-401] Closed producer
2022-01-20 05:08:14.347 INFO  [139723758618368] ProducerTest:215 | Closed
/pulsar/pulsar-client-cpp/tests/ProducerTest.cc:236: Failure
Value of: res
  Actual: Ok
Expected: ResultAlreadyClosed
Which is: AlreadyClosed
[  FAILED  ] ProducerTest.testSendAsyncCloseAsyncConcurrentlyWithLazyProducers (3431 ms)
[----------] 1 test from ProducerTest (3431 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (3435 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] ProducerTest.testSendAsyncCloseAsyncConcurrentlyWithLazyProducers

full logs at https://gist.github.com/lhotari/f37aefd7919f030399f3a5b7020baa23

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
BewareMyPowercommented, Jan 20, 2022

I’ll take a look when I’m free.

BTW, this flaky test might be introduced from https://github.com/apache/pulsar/pull/11570, it would be better if @Vanlightly could take a look first.

0reactions
BewareMyPowercommented, Mar 25, 2022

I found this test is just wrong. See https://github.com/apache/pulsar/blob/aef5f6d5e2d44f84c9c358f1d9dd9db1108a9d99/pulsar-client-cpp/tests/ProducerTest.cc#L236-L238

If we changed the code to

            if (i >= closedAt) {
                ASSERT_EQ(ResultAlreadyClosed, res);
            } else {
                ASSERT_EQ(ResultOk, res);
            }

The test will fail because the send results are all ResultAlreadyClosed, not only for i >= closedAt.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[C++] Remove the flaky and meaningless tests #15271 - GitHub
is called in another thread must complete with ResultAlreadyClosed . It's flaky because the synchronization between two threads is not strict. This test...
Read more >
FlakyTest - Android Developers
Stay organized with collections Save and categorize content based on your preferences. Dismiss Got it. Kotlin |Java. public abstract @interface FlakyTest
Read more >

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