Skip to content

bot: replaced retry function with Tenacity - #366

Merged
marco-c merged 25 commits into
mozilla:masterfrom
seb-sojka:removeRetryFunction
Jan 28, 2020
Merged

bot: replaced retry function with Tenacity#366
marco-c merged 25 commits into
mozilla:masterfrom
seb-sojka:removeRetryFunction

Conversation

@seb-sojka

Copy link
Copy Markdown
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

Comment threadbot/code_coverage_bot/taskcluster.py
Comment threadbot/code_coverage_bot/taskcluster.py Outdated
@marco-c

Copy link
Copy Markdown
Collaborator

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/).

Comment threadbot/requirements-dev.txt Outdated
@marco-c

Copy link
Copy Markdown
Collaborator

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

Comment threadbot/requirements-dev.txt Outdated
Comment threadbot/code_coverage_bot/uploader.py Outdated
@seb-sojka

seb-sojka commented Jan 11, 2020

Copy link
Copy Markdown
ContributorAuthor

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.

Comment threadbot/code_coverage_bot/utils.py Outdated
@marco-c

Copy link
Copy Markdown
Collaborator

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-sojkaand 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
Copy Markdown
ContributorAuthor

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.

Comment threadbot/code_coverage_bot/uploader.py Outdated
@marco-c

Copy link
Copy Markdown
Collaborator

Looks good, just one last thing to fix!

@marco-cmarco-c left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Collaborator

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

Sign up for freeto 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

@seb-sojka@marco-c