Skip to content

Commit

Permalink
Re-run flaky tests and ensure they pass at least 2 times
Browse files Browse the repository at this point in the history
  • Loading branch information
Davis Muro committed Jan 19, 2023
1 parent 9c094c4 commit d48fbe4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions onadata/apps/logger/tests/test_briefcase_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ def submission_list(request, context):
res.status_code,
";".join(media),
request.url,
storage.exists(os.path.join(settings.PROJECT_ROOT, "test_media/", media[0])),
storage.exists(
os.path.join(settings.PROJECT_ROOT, "test_media/", media[0])
),
)
response.encoding = res.get("content-type")
return get_streaming_content(res)
Expand All @@ -129,7 +131,7 @@ def get_streaming_content(res):
return content


@flaky(max_runs=3)
@flaky()
class TestBriefcaseClient(TestBase):
"""Test briefcase_client module."""

Expand Down Expand Up @@ -200,6 +202,7 @@ def test_download_xform_xml(self):
)
self.assertTrue(storage.exists(media_path))

@flaky(max_runs=3, min_passes=2)
def test_push(self):
"""Test ODK briefcase client push function."""
xforms = XForm.objects.filter(
Expand Down
3 changes: 3 additions & 0 deletions onadata/apps/main/tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import pytz
import requests
from django_digest.test import Client as DigestClient
from flaky import flaky
from mock import patch
from six import iteritems

Expand All @@ -36,6 +37,7 @@
uuid_regex = re.compile(r'(</instance>.*uuid[^//]+="\')([^\']+)(\'".*)', re.DOTALL)


@flaky()
class TestProcess(TestBase, SerializeMixin):
"""
Test form publishing processes.
Expand Down Expand Up @@ -153,6 +155,7 @@ def test_google_url_upload(self, mock_requests):
self.assertEqual(response.status_code, 200)
self.assertEqual(XForm.objects.count(), pre_count + 1)

@flaky(max_runs=3, min_passes=2)
@patch("onadata.apps.main.forms.requests")
def test_url_upload(self, mock_requests):
"""Test uploading an XLSForm from a URL."""
Expand Down

0 comments on commit d48fbe4

Please sign in to comment.