You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Increases base delay by (100ms * (2 ** attempt - 1))
wait=100*2** (attempt-1)
# Introduces jitter to the base delay; increases delay between 1ms to MAX_REQUEST_RETRY_JITTER (100ms)
wait+=randint(1, self.MAX_REQUEST_RETRY_JITTER())
This randomness could make tests flaky, especially if they depend on timing or retry behavior, since the wait time varies between runs.
Fixing a seed (e.g., random.seed(42) in a test fixture) would make test outcomes consistent and easier to debug. Without it, we risk intermittent failures in CI or locally, which could slow down development. (Im not saying this problems is happening, but it can happen). I didn't see any seeds being set into the test code...
What do you think about adding this to the test setup? I’d be happy to submit a PR if you’re open to it!
One quick question: I saw pytest-randomly in poetry.lock under test-randomorder—does that already handle seeds in some way I might have missed?
Thanks for your input!
Reproduction
.
Additional context
No response
auth0-python version
master branch
Python version
3.12.1
The text was updated successfully, but these errors were encountered:
Checklist
Description
I was checking out the code in
auth0/rest.py
and noticed that_calculate_wait
usesrandint
to add jitter to retry delaysauth0-python/auth0/rest.py
Lines 243 to 251 in 10555cb
This randomness could make tests flaky, especially if they depend on timing or retry behavior, since the wait time varies between runs.
Fixing a seed (e.g.,
random.seed(42)
in a test fixture) would make test outcomes consistent and easier to debug. Without it, we risk intermittent failures in CI or locally, which could slow down development. (Im not saying this problems is happening, but it can happen). I didn't see any seeds being set into the test code...What do you think about adding this to the test setup? I’d be happy to submit a PR if you’re open to it!
One quick question: I saw
pytest-randomly
inpoetry.lock
undertest-randomorder
—does that already handle seeds in some way I might have missed?Thanks for your input!
Reproduction
.
Additional context
No response
auth0-python version
master branch
Python version
3.12.1
The text was updated successfully, but these errors were encountered: