Skip to content

Commit 166d055

Browse files
sfc-gh-mmishchenkosfc-gh-pczajka
authored andcommitted
SNOW-2048239 revert zero timeout for oscp cache lock (#2283)
1 parent f1068b4 commit 166d055

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

src/snowflake/connector/ocsp_snowflake.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ def _deserialize(cls, opened_fd) -> _OCSPResponseValidationResultCache:
231231
OCSPResponseValidationResult,
232232
] = _OCSPResponseValidationResultCache(
233233
entry_lifetime=constants.DAY_IN_SECONDS,
234-
file_timeout=60.0,
235234
file_path={
236235
"linux": os.path.join(
237236
"~", ".cache", "snowflake", "ocsp_response_validation_cache.json"

test/unit/test_ocsp.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ def test_ocsp_bad_validity():
261261
del environ["SF_TEST_OCSP_FORCE_BAD_RESPONSE_VALIDITY"]
262262

263263

264-
@pytest.mark.flaky(reruns=3)
265264
def test_ocsp_single_endpoint():
266265
environ["SF_OCSP_ACTIVATE_NEW_ENDPOINT"] = "True"
267266
SnowflakeOCSP.clear_cache()
@@ -285,7 +284,6 @@ def test_ocsp_by_post_method():
285284
assert ocsp.validate(url, connection), f"Failed to validate: {url}"
286285

287286

288-
@pytest.mark.flaky(reruns=3)
289287
def test_ocsp_with_file_cache(tmpdir):
290288
"""OCSP tests and the cache server and file."""
291289
tmp_dir = str(tmpdir.mkdir("ocsp_response_cache"))
@@ -299,7 +297,6 @@ def test_ocsp_with_file_cache(tmpdir):
299297
assert ocsp.validate(url, connection), f"Failed to validate: {url}"
300298

301299

302-
@pytest.mark.flaky(reruns=3)
303300
@pytest.mark.skipolddriver
304301
def test_ocsp_with_bogus_cache_files(tmpdir, random_ocsp_response_validation_cache):
305302
with mock.patch(
@@ -339,7 +336,6 @@ def test_ocsp_with_bogus_cache_files(tmpdir, random_ocsp_response_validation_cac
339336
)
340337

341338

342-
@pytest.mark.flaky(reruns=3)
343339
@pytest.mark.skipolddriver
344340
def test_ocsp_with_outdated_cache(tmpdir, random_ocsp_response_validation_cache):
345341
with mock.patch(
@@ -400,7 +396,6 @@ def _store_cache_in_file(tmpdir, target_hosts=None):
400396
return filename, target_hosts
401397

402398

403-
@pytest.mark.flaky(reruns=3)
404399
def test_ocsp_with_invalid_cache_file():
405400
"""OCSP tests with an invalid cache file."""
406401
SnowflakeOCSP.clear_cache() # reset the memory cache
@@ -410,7 +405,6 @@ def test_ocsp_with_invalid_cache_file():
410405
assert ocsp.validate(url, connection), f"Failed to validate: {url}"
411406

412407

413-
@pytest.mark.flaky(reruns=3)
414408
@mock.patch(
415409
"snowflake.connector.ocsp_snowflake.SnowflakeOCSP._fetch_ocsp_response",
416410
side_effect=BrokenPipeError("fake error"),
@@ -433,7 +427,6 @@ def test_ocsp_cache_when_server_is_down(
433427
assert not cache_data, "no cache should present because of broken pipe"
434428

435429

436-
@pytest.mark.flaky(reruns=3)
437430
def test_concurrent_ocsp_requests(tmpdir):
438431
"""Run OCSP revocation checks in parallel. The memory and file caches are deleted randomly."""
439432
cache_file_name = path.join(str(tmpdir), "cache_file.txt")
@@ -478,7 +471,6 @@ def test_ocsp_revoked_certificate():
478471
assert ex.value.errno == ex.value.errno == ER_OCSP_RESPONSE_CERT_STATUS_REVOKED
479472

480473

481-
@pytest.mark.flaky(reruns=3)
482474
def test_ocsp_incomplete_chain():
483475
"""Tests incomplete chained certificate."""
484476
incomplete_chain_cert = path.join(

0 commit comments

Comments
 (0)