@@ -221,6 +221,7 @@ def test_ocsp_bad_validity():
221
221
del environ ["SF_TEST_OCSP_FORCE_BAD_RESPONSE_VALIDITY" ]
222
222
223
223
224
+ @pytest .mark .flaky (reruns = 3 )
224
225
def test_ocsp_single_endpoint ():
225
226
environ ["SF_OCSP_ACTIVATE_NEW_ENDPOINT" ] = "True"
226
227
SnowflakeOCSP .clear_cache ()
@@ -244,6 +245,7 @@ def test_ocsp_by_post_method():
244
245
assert ocsp .validate (url , connection ), f"Failed to validate: { url } "
245
246
246
247
248
+ @pytest .mark .flaky (reruns = 3 )
247
249
def test_ocsp_with_file_cache (tmpdir ):
248
250
"""OCSP tests and the cache server and file."""
249
251
tmp_dir = str (tmpdir .mkdir ("ocsp_response_cache" ))
@@ -257,6 +259,7 @@ def test_ocsp_with_file_cache(tmpdir):
257
259
assert ocsp .validate (url , connection ), f"Failed to validate: { url } "
258
260
259
261
262
+ @pytest .mark .flaky (reruns = 3 )
260
263
@pytest .mark .skipolddriver
261
264
def test_ocsp_with_bogus_cache_files (tmpdir , random_ocsp_response_validation_cache ):
262
265
with mock .patch (
@@ -296,6 +299,7 @@ def test_ocsp_with_bogus_cache_files(tmpdir, random_ocsp_response_validation_cac
296
299
)
297
300
298
301
302
+ @pytest .mark .flaky (reruns = 3 )
299
303
@pytest .mark .skipolddriver
300
304
def test_ocsp_with_outdated_cache (tmpdir , random_ocsp_response_validation_cache ):
301
305
with mock .patch (
@@ -356,6 +360,7 @@ def _store_cache_in_file(tmpdir, target_hosts=None):
356
360
return filename , target_hosts
357
361
358
362
363
+ @pytest .mark .flaky (reruns = 3 )
359
364
def test_ocsp_with_invalid_cache_file ():
360
365
"""OCSP tests with an invalid cache file."""
361
366
SnowflakeOCSP .clear_cache () # reset the memory cache
@@ -365,6 +370,7 @@ def test_ocsp_with_invalid_cache_file():
365
370
assert ocsp .validate (url , connection ), f"Failed to validate: { url } "
366
371
367
372
373
+ @pytest .mark .flaky (reruns = 3 )
368
374
@mock .patch (
369
375
"snowflake.connector.ocsp_snowflake.SnowflakeOCSP._fetch_ocsp_response" ,
370
376
side_effect = BrokenPipeError ("fake error" ),
@@ -387,6 +393,7 @@ def test_ocsp_cache_when_server_is_down(
387
393
assert not cache_data , "no cache should present because of broken pipe"
388
394
389
395
396
+ @pytest .mark .flaky (reruns = 3 )
390
397
def test_concurrent_ocsp_requests (tmpdir ):
391
398
"""Run OCSP revocation checks in parallel. The memory and file caches are deleted randomly."""
392
399
cache_file_name = path .join (str (tmpdir ), "cache_file.txt" )
@@ -431,6 +438,7 @@ def test_ocsp_revoked_certificate():
431
438
assert ex .value .errno == ex .value .errno == ER_OCSP_RESPONSE_CERT_STATUS_REVOKED
432
439
433
440
441
+ @pytest .mark .flaky (reruns = 3 )
434
442
def test_ocsp_incomplete_chain ():
435
443
"""Tests incomplete chained certificate."""
436
444
incomplete_chain_cert = path .join (
0 commit comments