Skip to content

Commit e9f9b5b

Browse files
authored
Merge pull request ckan#9154 from ckan/failing-in-github-actions-only
Investigate failing tests in github actions only
2 parents 181c4f1 + 5a3ccf5 commit e9f9b5b

File tree

1 file changed

+20
-27
lines changed

1 file changed

+20
-27
lines changed

ckanext/activity/tests/test_views.py

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import unittest.mock as mock
44
from datetime import datetime
5-
from time import sleep
65

76
import pytest
87
from bs4 import BeautifulSoup
@@ -770,19 +769,16 @@ def test_read_resource_as_it_used_to_be(self, app):
770769
# View as a sysadmin so we can see old versions of the dataset
771770
sysadmin = factories.SysadminWithToken()
772771
headers = {"Authorization": sysadmin["token"]}
773-
def got_orig():
774-
response = app.get(
775-
url_for(
776-
"activity.resource_history",
777-
id=dataset["name"],
778-
resource_id=resource["id"],
779-
activity_id=activity.id,
780-
),
781-
headers=headers,
782-
)
783-
return helpers.body_contains(response, "Original name")
784-
# slow response retry
785-
assert got_orig() or sleep(.5) or got_orig()
772+
response = app.get(
773+
url_for(
774+
"activity.resource_history",
775+
id=dataset["name"],
776+
resource_id=resource["id"],
777+
activity_id=activity.id,
778+
),
779+
headers=headers,
780+
)
781+
assert "Original name" in response.body
786782

787783
def test_read_deleted_resource_as_it_used_to_be(self, app):
788784
dataset = factories.Dataset(title="Dataset title")
@@ -804,19 +800,16 @@ def test_read_deleted_resource_as_it_used_to_be(self, app):
804800
# View as a sysadmin so we can see old versions of the dataset
805801
sysadmin = factories.SysadminWithToken()
806802
headers = {"Authorization": sysadmin["token"]}
807-
def got_orig():
808-
response = app.get(
809-
url_for(
810-
"activity.resource_history",
811-
id=dataset["name"],
812-
resource_id=resource["id"],
813-
activity_id=activity.id,
814-
),
815-
headers=headers,
816-
)
817-
return helpers.body_contains(response, resource["name"])
818-
# slow response retry
819-
assert got_orig() or sleep(.5) or got_orig()
803+
response = app.get(
804+
url_for(
805+
"activity.resource_history",
806+
id=dataset["name"],
807+
resource_id=resource["id"],
808+
activity_id=activity.id,
809+
),
810+
headers=headers,
811+
)
812+
assert resource["name"] in response.body
820813

821814
def test_changes(self, app):
822815
user = factories.UserWithToken()

0 commit comments

Comments
 (0)