-
Notifications
You must be signed in to change notification settings - Fork 146
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
Add test cases for RemoteConnector retry behavior #3504
Conversation
Refactored product code to make testing easier. Build up these tests to confirm behavoir when getting a non-throttled response that was reported by a CX. Signed-off-by: Peter Nied <[email protected]>
Could you please take updates from main to pass the integ tests. Thanks. |
Signed-off-by: Peter Nied <[email protected]>
Thanks @dhrubo-os merged from main. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3504 +/- ##
============================================
+ Coverage 80.25% 80.34% +0.09%
- Complexity 6906 6937 +31
============================================
Files 610 610
Lines 30077 30262 +185
Branches 3368 3384 +16
============================================
+ Hits 24137 24313 +176
- Misses 4487 4489 +2
- Partials 1453 1460 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hi @peternied, just curious, can you please share more context on why this is being done? I see that you mention |
@pyek-bot Sure - I can provide a little more context. Below is a redacted version of their configuration, they setup the client_config policy to retry indefinitely with exponential backoff. However, they never saw any failed requests retried. Probing in the code base to be sure why this was the case - this looks to be by design. I noticed a lack of test coverage and figured it would be good to area to augment. Especially if someone is interested in changing the behavior so retries occur on a broader set of failed responses. Redacted configuration
|
...rithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/RemoteConnectorExecutor.java
Show resolved
Hide resolved
...search/ml/engine/algorithms/remote/RemoteConnectorExecutor_RetryableActionExtensionTest.java
Outdated
Show resolved
Hide resolved
...search/ml/engine/algorithms/remote/RemoteConnectorExecutor_RetryableActionExtensionTest.java
Outdated
Show resolved
Hide resolved
Overall change looks good, added some nitpicks. Thanks for the contribution and providing the context! |
The number returned will now match the number of times `shouldRetry(...)` was called, whereas previously it was +1 times making the test harder to understand. Good suggestion @pyek-bot thanks! Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
@pyek-bot @dhrubo-os I've resolved the merge conflict, could I get another review so this change can be merged? |
The current ITs have covered this change. |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-3504-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 dd58f1861c2628ddf1ebad7326f948d554434356
# Push it to GitHub
git push --set-upstream origin backport/backport-3504-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x Then, create a pull request where the |
Description
Add test cases for RemoteConnector retry behavior
Refactored product code to make testing easier. Build up these tests to confirm behavior when getting a non-throttled response that was reported by a customer.
Check List
New functionality has been documented.API changes companion pull request created.--signoff
.Public documentation issue/PR created.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.