[FLUSS-1873][server] Added Retry Handler to Address Snapshotting Test Asynchrony #1881
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 #1873
Per Issue #1873, this pull request addresses a race condition that could sometimes occur and result in the
ReplicaTest.testBrokenSnapshotRecoverytest case failing (particularly during CI builds).Brief change log
This change introduces a static
triggerSnapshotTaskWithRetryhelper function which wraps the existingscheduledExecutorServiceinstance and issues the trigger functions within a retry loop and minor delay to help improve reliability. The previous explicitscheduledExecutorService.triggerNonPeriodicScheduledTask()calls have been replaced with this new function in the affected test case.Tests
The
ReplicaTest.testBrokenSnapshotRecoverywas initially updated to use an iterative approach (e.g., repeat 50 times) as mentioned in the original issue to reproduce the issue. After this was repeatably reproducible, the proposed retry-helper was introduced to verify the test would repeatedly pass through all of the iterations.The only change to the test were the previous replacement of the explicit
triggerNonPeriodicScheduledTask()calls with the newly added wrapper.API and Format
N/A
Documentation
N/A