[fix][test] Fix flaky test V1_ProducerConsumerTest#testActiveAndInActiveConsumerEntryCacheBehavior. - #18075
Merged
aloyszhang merged 1 commit intoOct 18, 2022
Conversation
…ntryCacheBehavior
Contributor
Author
|
@codelipenghui @Technoboy- @eolivelli @AnonHxy PTAL,thanks! |
Technoboy-
approved these changes
Oct 18, 2022
Codecov Report
@@ Coverage Diff @@
## master #18075 +/- ##
=============================================
+ Coverage 34.91% 47.52% +12.61%
- Complexity 5707 18023 +12316
=============================================
Files 607 1574 +967
Lines 53396 128320 +74924
Branches 5712 14116 +8404
=============================================
+ Hits 18644 60987 +42343
- Misses 32119 61122 +29003
- Partials 2633 6211 +3578
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Contributor
Author
|
/pulsarbot run-failure-checks |
Contributor
Author
|
@tisonkun PTAL,thanks! |
Contributor
Author
|
/pulsarbot run-failure-checks |
1 similar comment
Contributor
Author
|
/pulsarbot run-failure-checks |
tisonkun
approved these changes
Oct 18, 2022
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

In PR: https://github.com//pull/17273, when the read position is updated, the ManagedLedgerImpl#onCursorReadPositionUpdated method will be called, and finally ManagedCursorContainer#cursorUpdated will be called, thus making the slowestReaderPosition change:pulsar/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
Lines 2633 to 2639 in 0c7a0d1
Therefore, in testActiveAndInActiveConsumerEntryCacheBehavior, as long as the server pushes data to the client, the slowestReaderPosition will change.
So here the receive queue of the slower-subscriber is set to 1 to prevent the slowestReaderPosition from changing even if the subscription is not consumed.
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: lordcheng10#31