Skip to content

Reject negative wait_* values at retry construction - #153

Open
Pitchfork-and-Torch wants to merge 1 commit into
hynek:mainfrom
Pitchfork-and-Torch:cook/reject-negative-wait-params
Open

Pitchfork-and-Torch wants to merge 1 commit into
hynek:mainfrom
Pitchfork-and-Torch:cook/reject-negative-wait-params

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown

Summary

Validate wait_initial / wait_max / wait_jitter are >= 0 in _RetryContextIterator.from_params.

Negative values previously reached time.sleep / asyncio.sleep and raised a cryptic ValueError: sleep length must be non-negative. Callers now get a clear ValueError naming the bad parameter. attempts/timeout=-1 left unchanged (covered by existing tests).

Test plan

  • test_negative_wait_params_rejected passes
  • test_timeout_zero_warns still passes

Negative wait_initial/wait_max/wait_jitter previously reached
time.sleep/asyncio.sleep and raised a cryptic "sleep length must be
non-negative". Validate at _RetryContextIterator.from_params so callers
get a clear ValueError naming the bad parameter. attempts/timeout=-1
left unchanged (existing tests treat them as valid).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant