From 0c1950142bcc85fda37f97f058cfc2da6c01c1f1 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 18 Feb 2026 08:00:26 -0600 Subject: [PATCH 1/3] PYTHON-5708 Temporarily skip some BSON encryption tests --- test/asynchronous/test_encryption.py | 4 ++++ test/test_encryption.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/test/asynchronous/test_encryption.py b/test/asynchronous/test_encryption.py index b1dbc73f39..31677ffa9f 100644 --- a/test/asynchronous/test_encryption.py +++ b/test/asynchronous/test_encryption.py @@ -1022,12 +1022,14 @@ async def _test_corpus(self, opts): else: self.assertEqual(value["value"], corpus[key]["value"], key) + @pytest.skip(reason="PYTHON-5708") async def test_corpus(self): opts = AutoEncryptionOpts( self.kms_providers(), "keyvault.datakeys", kms_tls_options=DEFAULT_KMS_TLS ) await self._test_corpus(opts) + @pytest.skip(reason="PYTHON-5708") async def test_corpus_local_schema(self): # Configure the encrypted field via the local schema_map option. schemas = {"db.coll": self.fix_up_schema(json_data("corpus", "corpus-schema.json"))} @@ -1109,6 +1111,7 @@ async def test_03_bulk_batch_split(self): len([c for c in self.listener.started_command_names() if c == "insert"]), 2 ) + @pytest.skip(reason="PYTHON-5708") async def test_04_bulk_batch_split(self): limits_doc = json_data("limits", "limits-doc.json") doc1 = {"_id": "encryption_exceeds_2mib_1", "unencrypted": "a" * (_2_MiB - 2000)} @@ -1129,6 +1132,7 @@ async def test_05_insert_succeeds_just_under_16MiB(self): doc["_id"] = "under_16mib_bulk" await self.coll_encrypted.bulk_write([InsertOne(doc)]) + @pytest.skip(reason="PYTHON-5708") async def test_06_insert_fails_over_16MiB(self): limits_doc = json_data("limits", "limits-doc.json") doc = {"_id": "encryption_exceeds_16mib", "unencrypted": "a" * (_16_MiB - 2000)} diff --git a/test/test_encryption.py b/test/test_encryption.py index 88d37cfa0d..5913584ff3 100644 --- a/test/test_encryption.py +++ b/test/test_encryption.py @@ -1018,12 +1018,14 @@ def _test_corpus(self, opts): else: self.assertEqual(value["value"], corpus[key]["value"], key) + @pytest.skip(reason="PYTHON-5708") def test_corpus(self): opts = AutoEncryptionOpts( self.kms_providers(), "keyvault.datakeys", kms_tls_options=DEFAULT_KMS_TLS ) self._test_corpus(opts) + @pytest.skip(reason="PYTHON-5708") def test_corpus_local_schema(self): # Configure the encrypted field via the local schema_map option. schemas = {"db.coll": self.fix_up_schema(json_data("corpus", "corpus-schema.json"))} @@ -1105,6 +1107,7 @@ def test_03_bulk_batch_split(self): len([c for c in self.listener.started_command_names() if c == "insert"]), 2 ) + @pytest.skip(reason="PYTHON-5708") def test_04_bulk_batch_split(self): limits_doc = json_data("limits", "limits-doc.json") doc1 = {"_id": "encryption_exceeds_2mib_1", "unencrypted": "a" * (_2_MiB - 2000)} @@ -1125,6 +1128,7 @@ def test_05_insert_succeeds_just_under_16MiB(self): doc["_id"] = "under_16mib_bulk" self.coll_encrypted.bulk_write([InsertOne(doc)]) + @pytest.skip(reason="PYTHON-5708") def test_06_insert_fails_over_16MiB(self): limits_doc = json_data("limits", "limits-doc.json") doc = {"_id": "encryption_exceeds_16mib", "unencrypted": "a" * (_16_MiB - 2000)} From f2471d06923472efcd242d997d157f05e57ad04c Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 18 Feb 2026 08:03:54 -0600 Subject: [PATCH 2/3] fix skips --- test/asynchronous/test_encryption.py | 8 ++++---- test/test_encryption.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/asynchronous/test_encryption.py b/test/asynchronous/test_encryption.py index 31677ffa9f..0f246683d3 100644 --- a/test/asynchronous/test_encryption.py +++ b/test/asynchronous/test_encryption.py @@ -1022,14 +1022,14 @@ async def _test_corpus(self, opts): else: self.assertEqual(value["value"], corpus[key]["value"], key) - @pytest.skip(reason="PYTHON-5708") + @pytest.mark.skip(reason="PYTHON-5708") async def test_corpus(self): opts = AutoEncryptionOpts( self.kms_providers(), "keyvault.datakeys", kms_tls_options=DEFAULT_KMS_TLS ) await self._test_corpus(opts) - @pytest.skip(reason="PYTHON-5708") + @pytest.mark.skip(reason="PYTHON-5708") async def test_corpus_local_schema(self): # Configure the encrypted field via the local schema_map option. schemas = {"db.coll": self.fix_up_schema(json_data("corpus", "corpus-schema.json"))} @@ -1111,7 +1111,7 @@ async def test_03_bulk_batch_split(self): len([c for c in self.listener.started_command_names() if c == "insert"]), 2 ) - @pytest.skip(reason="PYTHON-5708") + @pytest.mark.skip(reason="PYTHON-5708") async def test_04_bulk_batch_split(self): limits_doc = json_data("limits", "limits-doc.json") doc1 = {"_id": "encryption_exceeds_2mib_1", "unencrypted": "a" * (_2_MiB - 2000)} @@ -1132,7 +1132,7 @@ async def test_05_insert_succeeds_just_under_16MiB(self): doc["_id"] = "under_16mib_bulk" await self.coll_encrypted.bulk_write([InsertOne(doc)]) - @pytest.skip(reason="PYTHON-5708") + @pytest.mark.skip(reason="PYTHON-5708") async def test_06_insert_fails_over_16MiB(self): limits_doc = json_data("limits", "limits-doc.json") doc = {"_id": "encryption_exceeds_16mib", "unencrypted": "a" * (_16_MiB - 2000)} diff --git a/test/test_encryption.py b/test/test_encryption.py index 5913584ff3..33540848ed 100644 --- a/test/test_encryption.py +++ b/test/test_encryption.py @@ -1018,14 +1018,14 @@ def _test_corpus(self, opts): else: self.assertEqual(value["value"], corpus[key]["value"], key) - @pytest.skip(reason="PYTHON-5708") + @pytest.mark.skip(reason="PYTHON-5708") def test_corpus(self): opts = AutoEncryptionOpts( self.kms_providers(), "keyvault.datakeys", kms_tls_options=DEFAULT_KMS_TLS ) self._test_corpus(opts) - @pytest.skip(reason="PYTHON-5708") + @pytest.mark.skip(reason="PYTHON-5708") def test_corpus_local_schema(self): # Configure the encrypted field via the local schema_map option. schemas = {"db.coll": self.fix_up_schema(json_data("corpus", "corpus-schema.json"))} @@ -1107,7 +1107,7 @@ def test_03_bulk_batch_split(self): len([c for c in self.listener.started_command_names() if c == "insert"]), 2 ) - @pytest.skip(reason="PYTHON-5708") + @pytest.mark.skip(reason="PYTHON-5708") def test_04_bulk_batch_split(self): limits_doc = json_data("limits", "limits-doc.json") doc1 = {"_id": "encryption_exceeds_2mib_1", "unencrypted": "a" * (_2_MiB - 2000)} @@ -1128,7 +1128,7 @@ def test_05_insert_succeeds_just_under_16MiB(self): doc["_id"] = "under_16mib_bulk" self.coll_encrypted.bulk_write([InsertOne(doc)]) - @pytest.skip(reason="PYTHON-5708") + @pytest.mark.skip(reason="PYTHON-5708") def test_06_insert_fails_over_16MiB(self): limits_doc = json_data("limits", "limits-doc.json") doc = {"_id": "encryption_exceeds_16mib", "unencrypted": "a" * (_16_MiB - 2000)} From 68215d057fe3e2bc3dcbe93ad83b4a71f92c36cd Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 18 Feb 2026 15:25:18 -0600 Subject: [PATCH 3/3] fixup skips --- test/asynchronous/test_encryption.py | 8 ++++---- test/test_encryption.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/asynchronous/test_encryption.py b/test/asynchronous/test_encryption.py index 0f246683d3..9650f7043f 100644 --- a/test/asynchronous/test_encryption.py +++ b/test/asynchronous/test_encryption.py @@ -876,6 +876,8 @@ async def test_views_are_prohibited(self): class TestCorpus(AsyncEncryptionIntegrationTest): + # PYTHON-5708: Encryption tests sending large payloads fail on some mongocryptd versions. + @async_client_context.require_version_max(6, 99) @unittest.skipUnless(any(AWS_CREDS.values()), "AWS environment credentials are not set") async def asyncSetUp(self): await super().asyncSetUp() @@ -1022,14 +1024,12 @@ async def _test_corpus(self, opts): else: self.assertEqual(value["value"], corpus[key]["value"], key) - @pytest.mark.skip(reason="PYTHON-5708") async def test_corpus(self): opts = AutoEncryptionOpts( self.kms_providers(), "keyvault.datakeys", kms_tls_options=DEFAULT_KMS_TLS ) await self._test_corpus(opts) - @pytest.mark.skip(reason="PYTHON-5708") async def test_corpus_local_schema(self): # Configure the encrypted field via the local schema_map option. schemas = {"db.coll": self.fix_up_schema(json_data("corpus", "corpus-schema.json"))} @@ -1054,6 +1054,8 @@ class TestBsonSizeBatches(AsyncEncryptionIntegrationTest): client_encrypted: AsyncMongoClient listener: OvertCommandListener + # PYTHON-5708: Encryption tests sending large payloads fail on some mongocryptd versions. + @async_client_context.require_version_max(6, 99) async def asyncSetUp(self): await super().asyncSetUp() db = async_client_context.client.db @@ -1111,7 +1113,6 @@ async def test_03_bulk_batch_split(self): len([c for c in self.listener.started_command_names() if c == "insert"]), 2 ) - @pytest.mark.skip(reason="PYTHON-5708") async def test_04_bulk_batch_split(self): limits_doc = json_data("limits", "limits-doc.json") doc1 = {"_id": "encryption_exceeds_2mib_1", "unencrypted": "a" * (_2_MiB - 2000)} @@ -1132,7 +1133,6 @@ async def test_05_insert_succeeds_just_under_16MiB(self): doc["_id"] = "under_16mib_bulk" await self.coll_encrypted.bulk_write([InsertOne(doc)]) - @pytest.mark.skip(reason="PYTHON-5708") async def test_06_insert_fails_over_16MiB(self): limits_doc = json_data("limits", "limits-doc.json") doc = {"_id": "encryption_exceeds_16mib", "unencrypted": "a" * (_16_MiB - 2000)} diff --git a/test/test_encryption.py b/test/test_encryption.py index 33540848ed..af9f2e3df7 100644 --- a/test/test_encryption.py +++ b/test/test_encryption.py @@ -872,6 +872,8 @@ def test_views_are_prohibited(self): class TestCorpus(EncryptionIntegrationTest): + # PYTHON-5708: Encryption tests sending large payloads fail on some mongocryptd versions. + @client_context.require_version_max(6, 99) @unittest.skipUnless(any(AWS_CREDS.values()), "AWS environment credentials are not set") def setUp(self): super().setUp() @@ -1018,14 +1020,12 @@ def _test_corpus(self, opts): else: self.assertEqual(value["value"], corpus[key]["value"], key) - @pytest.mark.skip(reason="PYTHON-5708") def test_corpus(self): opts = AutoEncryptionOpts( self.kms_providers(), "keyvault.datakeys", kms_tls_options=DEFAULT_KMS_TLS ) self._test_corpus(opts) - @pytest.mark.skip(reason="PYTHON-5708") def test_corpus_local_schema(self): # Configure the encrypted field via the local schema_map option. schemas = {"db.coll": self.fix_up_schema(json_data("corpus", "corpus-schema.json"))} @@ -1050,6 +1050,8 @@ class TestBsonSizeBatches(EncryptionIntegrationTest): client_encrypted: MongoClient listener: OvertCommandListener + # PYTHON-5708: Encryption tests sending large payloads fail on some mongocryptd versions. + @client_context.require_version_max(6, 99) def setUp(self): super().setUp() db = client_context.client.db @@ -1107,7 +1109,6 @@ def test_03_bulk_batch_split(self): len([c for c in self.listener.started_command_names() if c == "insert"]), 2 ) - @pytest.mark.skip(reason="PYTHON-5708") def test_04_bulk_batch_split(self): limits_doc = json_data("limits", "limits-doc.json") doc1 = {"_id": "encryption_exceeds_2mib_1", "unencrypted": "a" * (_2_MiB - 2000)} @@ -1128,7 +1129,6 @@ def test_05_insert_succeeds_just_under_16MiB(self): doc["_id"] = "under_16mib_bulk" self.coll_encrypted.bulk_write([InsertOne(doc)]) - @pytest.mark.skip(reason="PYTHON-5708") def test_06_insert_fails_over_16MiB(self): limits_doc = json_data("limits", "limits-doc.json") doc = {"_id": "encryption_exceeds_16mib", "unencrypted": "a" * (_16_MiB - 2000)}