@@ -232,6 +232,7 @@ async def test_ocsp_bad_validity():
232
232
del environ ["SF_TEST_OCSP_FORCE_BAD_RESPONSE_VALIDITY" ]
233
233
234
234
235
+ @pytest .mark .flaky (reruns = 3 )
235
236
async def test_ocsp_single_endpoint ():
236
237
environ ["SF_OCSP_ACTIVATE_NEW_ENDPOINT" ] = "True"
237
238
SnowflakeOCSP .clear_cache ()
@@ -255,6 +256,7 @@ async def test_ocsp_by_post_method():
255
256
assert await ocsp .validate (url , connection ), f"Failed to validate: { url } "
256
257
257
258
259
+ @pytest .mark .flaky (reruns = 3 )
258
260
async def test_ocsp_with_file_cache (tmpdir ):
259
261
"""OCSP tests and the cache server and file."""
260
262
tmp_dir = str (tmpdir .mkdir ("ocsp_response_cache" ))
@@ -268,6 +270,7 @@ async def test_ocsp_with_file_cache(tmpdir):
268
270
assert await ocsp .validate (url , connection ), f"Failed to validate: { url } "
269
271
270
272
273
+ @pytest .mark .flaky (reruns = 3 )
271
274
async def test_ocsp_with_bogus_cache_files (
272
275
tmpdir , random_ocsp_response_validation_cache
273
276
):
@@ -308,6 +311,7 @@ async def test_ocsp_with_bogus_cache_files(
308
311
), f"Failed to validate: { hostname } "
309
312
310
313
314
+ @pytest .mark .flaky (reruns = 3 )
311
315
async def test_ocsp_with_outdated_cache (tmpdir , random_ocsp_response_validation_cache ):
312
316
with mock .patch (
313
317
"snowflake.connector.ocsp_snowflake.OCSP_RESPONSE_VALIDATION_CACHE" ,
@@ -367,6 +371,7 @@ async def _store_cache_in_file(tmpdir, target_hosts=None):
367
371
return filename , target_hosts
368
372
369
373
374
+ @pytest .mark .flaky (reruns = 3 )
370
375
async def test_ocsp_with_invalid_cache_file ():
371
376
"""OCSP tests with an invalid cache file."""
372
377
SnowflakeOCSP .clear_cache () # reset the memory cache
@@ -376,6 +381,7 @@ async def test_ocsp_with_invalid_cache_file():
376
381
assert await ocsp .validate (url , connection ), f"Failed to validate: { url } "
377
382
378
383
384
+ @pytest .mark .flaky (reruns = 3 )
379
385
@mock .patch (
380
386
"snowflake.connector.aio._ocsp_snowflake.SnowflakeOCSP._fetch_ocsp_response" ,
381
387
new_callable = mock .AsyncMock ,
@@ -399,6 +405,7 @@ async def test_ocsp_cache_when_server_is_down(
399
405
assert not cache_data , "no cache should present because of broken pipe"
400
406
401
407
408
+ @pytest .mark .flaky (reruns = 3 )
402
409
async def test_concurrent_ocsp_requests (tmpdir ):
403
410
"""Run OCSP revocation checks in parallel. The memory and file caches are deleted randomly."""
404
411
cache_file_name = path .join (str (tmpdir ), "cache_file.txt" )
0 commit comments