Skip to content

bot: replaced retry function with Tenacity #366

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

Merged
merged 25 commits into from
Jan 28, 2020

Conversation

seb-sojka
Copy link
Contributor

Remove retry function and related RunException from utils.py for bot and replaces it with Tenacity retry in taskcluster.py and uploader.py
Fixes #110

@marco-c
Copy link
Collaborator

marco-c commented Jan 7, 2020

There are some linting failures (I suggest using pre-commit for that), and some test failures (you can run tests by doing cd bot and then python -m pytest -s -v tests/).

@marco-c
Copy link
Collaborator

marco-c commented Jan 9, 2020

@seb-sojka do you still want to work on this?

@seb-sojka
Copy link
Contributor Author

seb-sojka commented Jan 11, 2020

Hello,
I have run into an issue with the tester when changing to Tenacity for retries for perform_download function. It does not increase the call count but I have used print to see the perform_download occur 5 times.

@marco-c
Copy link
Collaborator

marco-c commented Jan 11, 2020

I have run into an issue with the tester when changing to Tenacity for retries for perform_download function. It does not increase the call count but I have used print to see the perform_download occur 5 times.

Probably tenacity is not using time.sleep. You can change the test to stop mocking it, and instead count the number of times the responses URL is hit (see https://github.com/getsentry/responses, something like assert len(responses.calls) == 5).

seb-sojka and others added 2 commits January 14, 2020 16:16
…s.py. Updated test_taskcluster.py to check on number of times a function is called
@seb-sojka
Copy link
Contributor Author

The error with linit and taskcluster_yml. I am unsure what the solution for this. I do not have this error locally when I run the pre-commit.

@marco-c
Copy link
Collaborator

marco-c commented Jan 28, 2020

Looks good, just one last thing to fix!

Copy link
Collaborator

@marco-c marco-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@marco-c
Copy link
Collaborator

marco-c commented Jan 28, 2020

If you want, here are some similar issues in this and other repos:
#392
mozilla/bugbug#1234

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.

Use tenacity (or similar) instead of re-implementing a retry function
2 participants