-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][test] Fix flaky test V1_ProducerConsumerTest#testActiveAndInActiveConsumerEntryCacheBehavior. #18075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix][test] Fix flaky test V1_ProducerConsumerTest#testActiveAndInActiveConsumerEntryCacheBehavior. #18075
Conversation
…ntryCacheBehavior
|
@codelipenghui @Technoboy- @eolivelli @AnonHxy PTAL,thanks! |
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.
|
|
/pulsarbot run-failure-checks |
aloyszhang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@tisonkun PTAL,thanks! |
|
/pulsarbot run-failure-checks |
1 similar comment
|
/pulsarbot run-failure-checks |
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