Skip to content

Commit 3ab4cfa

Browse files
author
Laurence Joseph Pakenham-Smith
authored
Merge pull request #47 from NHSDigital/apm-1710-update-tests-to-allow-retries
APM-1710 add retries to 504 and 418 tests
2 parents 7ad500c + 7a7de40 commit 3ab4cfa

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

e2e/tests/api_tests.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ async def test_api_status_with_service_header(api_client: APISessionClient):
7070
@pytest.mark.asyncio
7171
async def test_api_slowapp_slower_than_sync_wait(api_client: APISessionClient):
7272

73-
async with api_client.get("async-slowapp/slow?delay=5", headers={'x-sync-wait': '0.25'}) as r:
74-
assert r.status == 504, (r.status, r.reason, (await r.text())[:2000])
73+
r = await api_client.get("async-slowapp/slow?delay=5", allow_retries=True, max_retries=5, headers={'x-sync-wait': '0.25'})
74+
assert r.status == 504, (r.status, r.reason, (await r.text())[:2000])
7575

7676

7777
@pytest.mark.asyncio
7878
async def test_api_slowapp_responds_test_final_status(api_client: APISessionClient):
7979

80-
async with api_client.get("async-slowapp/slow?final_status=418&complete_in=0.5") as r:
81-
assert r.status == 418, (r.status, r.reason, (await r.text())[:2000])
82-
assert r.reason == "I'm a Teapot"
80+
r = await api_client.get("async-slowapp/slow?final_status=418&complete_in=0.5", allow_retries=True, max_retries=5)
81+
assert r.status == 418, (r.status, r.reason, (await r.text())[:2000])
82+
assert r.reason == "I'm a Teapot"

0 commit comments

Comments
 (0)