Repository navigation
[fix][test] Fix flaky PulsarBrokerStatsClientTest.testTopicInternalStats - #24341
Merged
Merged
Conversation
Member
|
Good job, I tested locally 4 times and it all passed |
dao-jun
approved these changes
May 23, 2025
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #24341 +/- ##
============================================
+ Coverage 73.57% 74.23% +0.65%
- Complexity 32624 32630 +6
============================================
Files 1877 1866 -11
Lines 139502 145126 +5624
Branches 15299 16593 +1294
============================================
+ Hits 102638 107733 +5095
+ Misses 28908 28858 -50
- Partials 7956 8535 +579
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
KannarFr
pushed a commit
to CleverCloud/pulsar
that referenced
this pull request
Sep 22, 2025
walkinggo
pushed a commit
to walkinggo/pulsar
that referenced
this pull request
Oct 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
This unit test
assertTrue(cursor.totalNonContiguousDeletedMessagesRange > 0 && (cursor.totalNonContiguousDeletedMessagesRange) < numberOfMsgs / 2)reports an error because the consumer's acknowledge method is implemented one-way and the server may not have processed the ack request yet beforetopic.getInternalStats, sototalNonContiguousDeletedMessagesRangeis sometimes equal to 0.pulsar/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java
Line 616 in bdf6277
At the same time,
assertFalse(cursor.subscriptionHavePendingRead)sometimes goes wrong unless we close the consumer first.Modifications
Optimize assert logic to ensure the robustness of unit tests.
Documentation
docdoc-requireddoc-not-neededdoc-complete