Skip to content

Commit a54d9d0

Browse files
committed
Merge branch 'master' of github.com:mongodb/mongo-python-driver
2 parents d07301e + f29c7b1 commit a54d9d0

File tree

11 files changed

+28
-7
lines changed

11 files changed

+28
-7
lines changed

.evergreen/generated_configs/variants.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ buildvariants:
7575
display_name: Atlas connect RHEL8
7676
run_on:
7777
- rhel87-small
78+
expansions:
79+
TEST_NAME: atlas_connect
7880
tags: [pr]
7981

8082
# Atlas data lake tests

.evergreen/scripts/generate_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ def create_atlas_connect_variants():
425425
get_variant_name("Atlas connect", host),
426426
tags=["pr"],
427427
host=DEFAULT_HOST,
428+
expansions=dict(TEST_NAME="atlas_connect"),
428429
)
429430
]
430431

.evergreen/scripts/setup_tests.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,18 @@ def handle_test_env() -> None:
417417
run_command(f"bash {auth_aws_dir}/setup-secrets.sh")
418418

419419
if test_name == "atlas_connect":
420-
get_secrets("drivers/atlas_connect")
420+
secrets = get_secrets("drivers/atlas_connect")
421+
422+
# Write file with Atlas X509 client certificate:
423+
decoded = base64.b64decode(secrets["ATLAS_X509_DEV_CERT_BASE64"]).decode("utf8")
424+
cert_file = ROOT / ".evergreen/atlas_x509_dev_client_certificate.pem"
425+
with cert_file.open("w") as file:
426+
file.write(decoded)
427+
write_env(
428+
"ATLAS_X509_DEV_WITH_CERT",
429+
secrets["ATLAS_X509_DEV"] + "&tlsCertificateKeyFile=" + str(cert_file),
430+
)
431+
421432
# We do not want the default client_context to be initialized.
422433
write_env("DISABLE_CONTEXT")
423434

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ expansion.yml
3030
.evergreen/scripts/test-env.sh
3131
specifications/
3232
results.json
33+
.evergreen/atlas_x509_dev_client_certificate.pem
3334

3435
# Lambda temp files
3536
test/lambda/.aws-sam

test/asynchronous/test_cursor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ async def test_to_list_length(self):
14111411
async def test_to_list_csot_applied(self):
14121412
client = await self.async_single_client(timeoutMS=500, w=1)
14131413
coll = client.pymongo.test
1414-
# Initialize the client with a larger timeout to help make test less flakey
1414+
# Initialize the client with a larger timeout to help make test less flaky
14151415
with pymongo.timeout(10):
14161416
await coll.insert_many([{} for _ in range(5)])
14171417
cursor = coll.find({"$where": delay(1)})
@@ -1453,7 +1453,7 @@ async def test_command_cursor_to_list_length(self):
14531453
async def test_command_cursor_to_list_csot_applied(self):
14541454
client = await self.async_single_client(timeoutMS=500, w=1)
14551455
coll = client.pymongo.test
1456-
# Initialize the client with a larger timeout to help make test less flakey
1456+
# Initialize the client with a larger timeout to help make test less flaky
14571457
with pymongo.timeout(10):
14581458
await coll.insert_many([{} for _ in range(5)])
14591459
fail_command = {

test/asynchronous/test_retryable_reads.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class TestPoolPausedError(AsyncIntegrationTest):
8787
async def test_pool_paused_error_is_retryable(self):
8888
if "PyPy" in sys.version:
8989
# Tracked in PYTHON-3519
90-
self.skipTest("Test is flakey on PyPy")
90+
self.skipTest("Test is flaky on PyPy")
9191
cmap_listener = CMAPListener()
9292
cmd_listener = OvertCommandListener()
9393
client = await self.async_rs_or_single_client(

test/asynchronous/test_srv_polling.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ def empty_seedlist():
262262

263263
await self._test_recover_from_initial(empty_seedlist)
264264

265+
@flaky(reason="PYTHON-5315")
265266
async def test_recover_from_initially_erroring_seedlist(self):
266267
def erroring_seedlist():
267268
raise ConfigurationError

test/atlas/test_connection.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"ATLAS_SRV_FREE": os.environ.get("ATLAS_SRV_FREE"),
4343
"ATLAS_SRV_TLS11": os.environ.get("ATLAS_SRV_TLS11"),
4444
"ATLAS_SRV_TLS12": os.environ.get("ATLAS_SRV_TLS12"),
45+
"ATLAS_X509_DEV_WITH_CERT": os.environ.get("ATLAS_X509_DEV_WITH_CERT"),
4546
}
4647

4748

@@ -91,6 +92,9 @@ def test_srv_tls_11(self):
9192
def test_srv_tls_12(self):
9293
self.connect_srv(URIS["ATLAS_SRV_TLS12"])
9394

95+
def test_x509_with_cert(self):
96+
self.connect(URIS["ATLAS_X509_DEV_WITH_CERT"])
97+
9498
def test_uniqueness(self):
9599
"""Ensure that we don't accidentally duplicate the test URIs."""
96100
uri_to_names = defaultdict(list)

test/test_cursor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,7 +1402,7 @@ def test_to_list_length(self):
14021402
def test_to_list_csot_applied(self):
14031403
client = self.single_client(timeoutMS=500, w=1)
14041404
coll = client.pymongo.test
1405-
# Initialize the client with a larger timeout to help make test less flakey
1405+
# Initialize the client with a larger timeout to help make test less flaky
14061406
with pymongo.timeout(10):
14071407
coll.insert_many([{} for _ in range(5)])
14081408
cursor = coll.find({"$where": delay(1)})
@@ -1444,7 +1444,7 @@ def test_command_cursor_to_list_length(self):
14441444
def test_command_cursor_to_list_csot_applied(self):
14451445
client = self.single_client(timeoutMS=500, w=1)
14461446
coll = client.pymongo.test
1447-
# Initialize the client with a larger timeout to help make test less flakey
1447+
# Initialize the client with a larger timeout to help make test less flaky
14481448
with pymongo.timeout(10):
14491449
coll.insert_many([{} for _ in range(5)])
14501450
fail_command = {

test/test_retryable_reads.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class TestPoolPausedError(IntegrationTest):
8787
def test_pool_paused_error_is_retryable(self):
8888
if "PyPy" in sys.version:
8989
# Tracked in PYTHON-3519
90-
self.skipTest("Test is flakey on PyPy")
90+
self.skipTest("Test is flaky on PyPy")
9191
cmap_listener = CMAPListener()
9292
cmd_listener = OvertCommandListener()
9393
client = self.rs_or_single_client(

0 commit comments

Comments
 (0)