Skip to content

Commit 81717ba

Browse files
committed
increase timeout and encode path
1 parent c3d6969 commit 81717ba

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

.evergreen/scripts/setup_tests.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import stat
99
import tarfile
1010
from pathlib import Path
11-
from time import sleep
1211
from urllib import request
1312

1413
from utils import (
@@ -322,7 +321,6 @@ def handle_test_env() -> None:
322321
env["SERVER_TYPE"] = server_type
323322
env["OCSP_ALGORITHM"] = ocsp_algo
324323
run_command(f"bash {DRIVERS_TOOLS}/.evergreen/ocsp/setup.sh", env=env)
325-
sleep(5)
326324

327325
# The mock OCSP responder MUST BE started before the mongod as the mongod expects that
328326
# a responder will be available upon startup.
@@ -339,7 +337,6 @@ def handle_test_env() -> None:
339337
elif opts.quiet:
340338
cmd.append("-q")
341339
run_command(cmd, cwd=DRIVERS_TOOLS)
342-
sleep(5)
343340

344341
if SSL != "nossl":
345342
if not DRIVERS_TOOLS:

test/ocsp/test_ocsp.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import os
2020
import sys
2121
import unittest
22+
from pathlib import Path
2223

2324
import pytest
2425

@@ -38,15 +39,9 @@
3839
FORMAT = "%(asctime)s %(levelname)s %(module)s %(message)s"
3940
logging.basicConfig(format=FORMAT, level=logging.DEBUG)
4041

41-
if sys.platform == "win32":
42-
# The non-stapled OCSP endpoint check is slow on Windows.
43-
TIMEOUT_MS = 5000
44-
else:
45-
TIMEOUT_MS = 500
46-
4742

4843
def _connect(options):
49-
uri = f"mongodb://localhost:27017/?serverSelectionTimeoutMS={TIMEOUT_MS}&tlsCAFile={CA_FILE}&{options}"
44+
uri = f"mongodb://localhost:27017/?serverSelectionTimeoutMS=5000&tlsCAFile={Path(CA_FILE).as_posix()}&{options}"
5045
print(uri)
5146
try:
5247
client = pymongo.MongoClient(uri)

0 commit comments

Comments
 (0)