-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Flaky-test: SimpleProducerConsumerTest.testMultiTopicsConsumerImplPauseForManualSubscription #23485
Comments
Hi @lhotari
// 6. should not consume any messages
Awaitility.await().untilAsserted(() -> assertNull(consumer.receive(RECEIVE_TIMEOUT_SECONDS, TimeUnit.SECONDS))); instead of: // 6. should not consume any messages
assertNull(consumer.receive(RECEIVE_TIMEOUT_SECONDS, TimeUnit.SECONDS)); With the current test code, it is possible that a message is received in the first call of the await, but no message is received in the next call, and then
It seems, that the multi-topic consumer is automatically resumed between steps 2 and 7 in |
Very good analysis @pdolif ! One detail that caught my eye in the test is step 3: pulsar/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java Lines 3541 to 3542 in 7367f1c
That violates principles of testing where tests should test the public API and externally observable behaviors. There are a lot of such tests in the Pulsar code base and we should also move towards a direction where this wouldn't carried forward.
It might be different. the pausing logic seems to be different than what is tested. Calling |
Search before asking
Example failure
https://github.com/apache/pulsar/actions/runs/11407423480/job/31743771210?pr=23484#step:11:1686
Exception stacktrace
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: