[fix][test]fix flaky MessagePayloadProcessorTest.testDefaultProcessor#24710
Merged
codelipenghui merged 1 commit intoapache:masterfrom Sep 8, 2025
Merged
[fix][test]fix flaky MessagePayloadProcessorTest.testDefaultProcessor#24710codelipenghui merged 1 commit intoapache:masterfrom
codelipenghui merged 1 commit intoapache:masterfrom
Conversation
Technoboy-
approved these changes
Sep 8, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #24710 +/- ##
============================================
+ Coverage 74.12% 74.17% +0.04%
- Complexity 33068 33476 +408
============================================
Files 1895 1895
Lines 147979 147979
Branches 17137 17137
============================================
+ Hits 109693 109759 +66
+ Misses 29524 29463 -61
+ Partials 8762 8757 -5
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
codelipenghui
approved these changes
Sep 8, 2025
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.
Fixes #24709
Motivation
The flakiness occurred because
Assert.assertEquals(processor.getTotalRefCnt(), 2 * numBatches)1 was sometimes executed beforetotalRefCnt += ((MessagePayloadImpl) payload).getByteBuf().refCnt().2 This race condition led to inconsistent test results. By updating the reference count first, we ensure the assertion always evaluates correctly.Modifications
Moved
totalRefCnt += ((MessagePayloadImpl) payload).getByteBuf().refCnt()2 above theMessagePayloadProcessor.DEFAULT.process3 call.Verifying this change
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: 3pacccccc#25