Skip to content

Commit e89f036

Browse files
Merge pull request #838 from VWS-Python/leeway
Increase leeway in some of the usage tests
2 parents 43e5756 + 588111e commit e89f036

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

tests/mock_vws/test_flask_app_usage.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class TestProcessingTime:
6565

6666
# There is a race condition in this test type - if tests start to
6767
# fail, consider increasing the leeway.
68-
LEEWAY = 0.05
68+
LEEWAY = 0.1
6969

7070
def test_default(
7171
self,
@@ -174,6 +174,10 @@ class TestCustomQueryProcessDeletionSeconds:
174174
until it is not processed by the query endpoint.
175175
"""
176176

177+
# There is a race condition in this test type - if tests start to
178+
# fail, consider increasing the leeway.
179+
LEEWAY = 0.2
180+
177181
def test_default(
178182
self,
179183
high_quality_image: io.BytesIO,
@@ -194,7 +198,7 @@ def test_default(
194198
)
195199

196200
expected = 3
197-
assert abs(expected - time_taken) < 0.1
201+
assert abs(expected - time_taken) < self.LEEWAY
198202

199203
def test_custom(
200204
self,
@@ -220,7 +224,7 @@ def test_custom(
220224
)
221225

222226
expected = query_processes_deletion
223-
assert abs(expected - time_taken) < 0.1
227+
assert abs(expected - time_taken) < self.LEEWAY
224228

225229

226230
class TestAddDatabase:

tests/mock_vws/test_requests_mock_usage.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class TestProcessingTime:
9999

100100
# There is a race condition in this test type - if tests start to
101101
# fail, consider increasing the leeway.
102-
LEEWAY = 0.05
102+
LEEWAY = 0.1
103103

104104
def test_default(self, image_file_failed_state: io.BytesIO) -> None:
105105
"""
@@ -288,6 +288,10 @@ class TestCustomQueryProcessDeletionSeconds:
288288
until it is not processed by the query endpoint.
289289
"""
290290

291+
# There is a race condition in this test type - if tests start to
292+
# fail, consider increasing the leeway.
293+
LEEWAY = 0.2
294+
291295
def test_default(
292296
self,
293297
high_quality_image: io.BytesIO,
@@ -308,7 +312,7 @@ def test_default(
308312
)
309313

310314
expected = 3
311-
assert abs(expected - time_taken) < 0.1
315+
assert abs(expected - time_taken) < self.LEEWAY
312316

313317
def test_custom(
314318
self,
@@ -331,7 +335,7 @@ def test_custom(
331335
)
332336

333337
expected = query_processes_deletion
334-
assert abs(expected - time_taken) < 0.1
338+
assert abs(expected - time_taken) < self.LEEWAY
335339

336340

337341
class TestStates:

0 commit comments

Comments
 (0)