Naresh-kumar-Thodupunoori opened a new pull request, #4511: URL: https://github.com/apache/gravitino/pull/4511
# feat: Implement Retry Mechanism in `TestFetchFileUtils` for Network-Related Issues ## Description This pull request addresses the issue of inconsistent test results in the `TestFetchFileUtils` class due to network-related failures, specifically `SocketTimeoutExceptions`, by implementing a retry mechanism in the `testDownloadFromHTTP()` method. ## What changes were proposed in this pull request? This PR introduces the following changes: - **Retry Mechanism**: Added a configurable number of retry attempts to the `testDownloadFromHTTP()` method. - **Exponential Backoff**: Implemented a delay between retry attempts using an exponential backoff strategy to reduce the frequency of retry attempts over time. - **Asynchronous Handling**: Integrated `await()` for handling asynchronous retry logic, improving the test's robustness against transient network issues. - **Enhanced Error Handling**: Improved error reporting for failed download attempts, providing more detailed feedback when retries are exhausted. ## Why are the changes needed? These changes are necessary because: - The existing implementation of `testDownloadFromHTTP()` was prone to failures caused by `SocketTimeoutExceptions`, leading to inconsistent test outcomes, particularly in environments with unreliable network connections. - By introducing a retry mechanism, the test suite becomes more resilient to network instability, ensuring more consistent and reliable test results. - The retry mechanism also ensures that the test will fail appropriately if persistent network issues occur, maintaining the integrity of the test suite. **Fix**: #4483 ## Does this PR introduce any user-facing change? No, this PR does not introduce any user-facing changes. The updates are confined to the test suite and do not impact any user-facing APIs, functionality, or configuration properties. ## How was this patch tested? The patch was tested using the following methods: - Updated the `testDownloadFromHTTP()` test to include the retry logic and verified consistent pass results under stable network conditions. - Conducted manual testing by deliberately disrupting network connectivity to ensure the retry mechanism triggers as expected. - Executed the test over 100 iterations to confirm that the retry mechanism does not introduce any new flakiness or instability. - Verified that the test fails appropriately after all retry attempts are exhausted. - Ensured that the overall test execution time remains within acceptable limits under normal network conditions. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
