[test] Fix flaky AdjustIsrITCase by retrying produce request #2468
+1
−1
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.
Purpose
Linked issue: close #2242
Fixes the flaky integration test
AdjustIsrITCase.testIsrShrinkAndExpandby accounting for the delay in ISR shrinkage detection.Brief change log
The Problem:
The test was failing intermittently because it attempted to execute a
produceLogrequest immediately after stopping a follower replica. Due to theLOG_REPLICA_MAX_LAG_TIMEconfiguration (3 seconds), there is a delay before the Leader detects the follower failure and shrinks the In-Sync Replicas (ISR) set. During this window:NOT_ENOUGH_REPLICASorTIMEOUTAssertionFailedError: Expecting value to be false but was trueThe Fix:
Modified
testIsrShrinkAndExpandto wrap the produce request in aretryblock, allowing the Leader sufficient time to detect the follower failure and shrink the ISR before proceeding with the write operation.Tests
LOG_REPLICA_MAX_LAG_TIMEto 60s, causing 100% test failure with the original codemvn test -pl fluss-server -Dtest=AdjustIsrITCaseto ensure stabilityAPI and Format
Documentation
no - This is a test-only fix with no user-facing changes.