Skip to content

Commit

Permalink
Retrying a flaky test (#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazet authored Mar 15, 2024
1 parent bea388b commit dd94f85
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ repos:
- types-PyYAML==6.0.12.11
- types-redis==4.6.0.5
- types-requests==2.31.0.2
- types-retry==0.9.9.4
- types-termcolor==1.1.6.2
- types-tqdm==4.66.0.2
- uvicorn==0.23.2
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ PyYAML==6.0.1
redis==5.0.3
requests==2.31.0
requests-mock==1.11.0
retry==0.9.2
SQLAlchemy==2.0.28
semver==3.0.2
shodan==1.31.0
Expand Down
4 changes: 4 additions & 0 deletions test/modules/test_wordpress_bruter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from freezegun import freeze_time
from karton.core import Task
from retry import retry

from artemis.binds import TaskStatus, TaskType, WebApplication
from artemis.modules.wordpress_bruter import PASSWORDS, WordPressBruter
Expand Down Expand Up @@ -41,7 +42,10 @@ def test_getting_passwords_ip(self) -> None:
)
self.assertEqual(passwords, PASSWORDS)

@retry(tries=3)
def test_simple(self) -> None:
self.setUp() # @retry() will not rerun setUp

task = Task(
headers={"type": TaskType.WEBAPP, "webapp": WebApplication.WORDPRESS},
payload={"url": "http://test-wordpress-easy-password"},
Expand Down

0 comments on commit dd94f85

Please sign in to comment.