test: add unit tests for retry utility module#560
Open
JiayuuWang wants to merge 1 commit into666ghj:mainfrom
Open
test: add unit tests for retry utility module#560JiayuuWang wants to merge 1 commit into666ghj:mainfrom
JiayuuWang wants to merge 1 commit into666ghj:mainfrom
Conversation
Added 11 tests covering: - Sync decorator: success, retry, exhaust retries, max_delay cap - on_retry callback, jitter behavior - RetryableAPIClient batch processing logic
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.
Summary
Added 11 unit tests for the retry utility module (
backend/app/utils/retry.py).Tests Added
TestRetryWithBackoff:test_success_on_first_attempt- verifies no retry on immediate successtest_retry_on_failure_then_success- verifies retry and eventual successtest_exhaust_retries_and_raise- verifies exception propagation after retriestest_respects_max_delay- verifies delay cap before jittertest_on_retry_callback- verifies callback is called on each retrytest_jitter_reduces_collision- verifies jitter produces varying delaysTestRetryableAPIClientLogic:test_successful_call- batch single item successtest_retry_then_success- batch with retriestest_exhaust_retries- batch exhausting retriestest_batch_continues_on_failure- batch continues on individual failuretest_batch_stops_on_failure- batch stops when continue_on_failure=FalseDesign Decisions
contribot/fix-test-importsPR🤖 Generated with Claude Code