Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Sep 22, 2023
1 parent 2d90a8f commit 42c292e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/aio/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ async def test_retry_on_request_timeout():
parent_request = super(type(session), session)._request
async_mock = mock.AsyncMock()
async_mock.side_effect = parent_request
total_time = 0.0
with get_http_server(server_handler=TimeoutHttpHandler):
with mock.patch('reportportal_client.aio.http.ClientSession._request', async_mock):
async with session:
Expand All @@ -71,8 +72,8 @@ async def test_retry_on_request_timeout():
except Exception as exc:
exception = exc
total_time = time.time() - start_time
retries_and_delays = 6 + 0.02 + 0.4 + 8
assert exception is not None
assert async_mock.call_count == 6
assert total_time > retries_and_delays
assert total_time < retries_and_delays * 1.5
retries_and_delays = 6 + 0.02 + 0.4 + 8
assert exception is not None
assert async_mock.call_count == 6
assert total_time > retries_and_delays
assert total_time < retries_and_delays * 1.5

0 comments on commit 42c292e

Please sign in to comment.