Skip to content

Commit

Permalink
Update tests to retry on specific exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
nothingface0 committed Aug 1, 2024
1 parent ebb94ff commit 8a8a072
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
SSO_CLIENT_SECRET: ${{ secrets.SSO_CLIENT_SECRET }}
ENVIRONMENT: ${{ vars.ENVIRONMENT }}
run: |
pytest tests -s
pytest tests -s --retries 2
10 changes: 10 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from requests.exceptions import ChunkedEncodingError


def pytest_set_filtered_exceptions():
"""
pytest-retry: Any test will be retried if it fails due to ChunkedEncodingError,
which occurs due to runregistry not being able to serve many hardcore requests
at the same time.
"""
return [ChunkedEncodingError]
1 change: 1 addition & 0 deletions testing-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pytest>=3.6
pytest-retry
pytest-cov
codecov
-e .

0 comments on commit 8a8a072

Please sign in to comment.