From 1c03585695e5410ccc765d34b3c6d11d977abdb3 Mon Sep 17 00:00:00 2001 From: Cloud User Date: Wed, 3 Jun 2026 01:30:50 +0000 Subject: [PATCH 1/3] resyncing specs 06-03-2026 --- .../encryptedFields-prefix-suffix-ci-di.json | 40 +++++++++++++++++++ .../data/encryptedFields-substring-ci-di.json | 31 ++++++++++++++ ...kout-custom-maxConnecting-is-enforced.json | 6 ++- ...ol-checkout-maxConnecting-is-enforced.json | 6 ++- .../pool-checkout-maxConnecting-timeout.json | 6 ++- ...-minPoolSize-connection-maxConnecting.json | 6 ++- ...out-returned-connection-maxConnecting.json | 6 ++- ...lear-interrupting-pending-connections.json | 6 ++- test/load_balancer/cursors.json | 8 ++-- test/load_balancer/sdam-error-handling.json | 6 +-- .../operation-id.json | 4 +- .../server_selection_logging/replica-set.json | 2 +- test/server_selection_logging/sharded.json | 2 +- test/server_selection_logging/standalone.json | 2 +- .../unified/callback-aborts.json | 8 ++-- .../unified/callback-commits.json | 8 ++-- test/transactions/unified/commit.json | 8 +++- .../unified/retryable-writes.json | 8 +++- 18 files changed, 129 insertions(+), 34 deletions(-) create mode 100644 test/client-side-encryption/etc/data/encryptedFields-prefix-suffix-ci-di.json create mode 100644 test/client-side-encryption/etc/data/encryptedFields-substring-ci-di.json diff --git a/test/client-side-encryption/etc/data/encryptedFields-prefix-suffix-ci-di.json b/test/client-side-encryption/etc/data/encryptedFields-prefix-suffix-ci-di.json new file mode 100644 index 0000000000..c43bf9390d --- /dev/null +++ b/test/client-side-encryption/etc/data/encryptedFields-prefix-suffix-ci-di.json @@ -0,0 +1,40 @@ +{ + "fields": [ + { + "keyId": { + "$binary": { + "base64": "EjRWeBI0mHYSNBI0VniQEg==", + "subType": "04" + } + }, + "path": "encryptedText", + "bsonType": "string", + "queries": [ + { + "queryType": "prefixPreview", + "strMinQueryLength": { + "$numberInt": "2" + }, + "strMaxQueryLength": { + "$numberInt": "10" + }, + "contention": 0, + "caseSensitive": false, + "diacriticSensitive": false + }, + { + "queryType": "suffixPreview", + "strMinQueryLength": { + "$numberInt": "2" + }, + "strMaxQueryLength": { + "$numberInt": "10" + }, + "contention": 0, + "caseSensitive": false, + "diacriticSensitive": false + } + ] + } + ] +} diff --git a/test/client-side-encryption/etc/data/encryptedFields-substring-ci-di.json b/test/client-side-encryption/etc/data/encryptedFields-substring-ci-di.json new file mode 100644 index 0000000000..d6aadfb877 --- /dev/null +++ b/test/client-side-encryption/etc/data/encryptedFields-substring-ci-di.json @@ -0,0 +1,31 @@ +{ + "fields": [ + { + "keyId": { + "$binary": { + "base64": "EjRWeBI0mHYSNBI0VniQEg==", + "subType": "04" + } + }, + "path": "encryptedText", + "bsonType": "string", + "queries": [ + { + "queryType": "substringPreview", + "strMaxLength": { + "$numberInt": "10" + }, + "strMinQueryLength": { + "$numberInt": "2" + }, + "strMaxQueryLength": { + "$numberInt": "10" + }, + "contention": 0, + "caseSensitive": false, + "diacriticSensitive": false + } + ] + } + ] +} \ No newline at end of file diff --git a/test/connection_monitoring/pool-checkout-custom-maxConnecting-is-enforced.json b/test/connection_monitoring/pool-checkout-custom-maxConnecting-is-enforced.json index 6620f82fd9..9a7c0174c5 100644 --- a/test/connection_monitoring/pool-checkout-custom-maxConnecting-is-enforced.json +++ b/test/connection_monitoring/pool-checkout-custom-maxConnecting-is-enforced.json @@ -17,13 +17,15 @@ ], "closeConnection": false, "blockConnection": true, - "blockTimeMS": 500 + "blockTimeMS": 500, + "appName": "PoolCheckoutCustomMaxConnectingIsEnforced" } }, "poolOptions": { "maxConnecting": 1, "maxPoolSize": 2, - "waitQueueTimeoutMS": 5000 + "waitQueueTimeoutMS": 5000, + "appName": "PoolCheckoutCustomMaxConnectingIsEnforced" }, "operations": [ { diff --git a/test/connection_monitoring/pool-checkout-maxConnecting-is-enforced.json b/test/connection_monitoring/pool-checkout-maxConnecting-is-enforced.json index 3a63818bfe..418ec7986f 100644 --- a/test/connection_monitoring/pool-checkout-maxConnecting-is-enforced.json +++ b/test/connection_monitoring/pool-checkout-maxConnecting-is-enforced.json @@ -19,12 +19,14 @@ ], "closeConnection": false, "blockConnection": true, - "blockTimeMS": 800 + "blockTimeMS": 800, + "appName": "PoolCheckoutMaxConnectingIsEnforced" } }, "poolOptions": { "maxPoolSize": 10, - "waitQueueTimeoutMS": 5000 + "waitQueueTimeoutMS": 5000, + "appName": "PoolCheckoutMaxConnectingIsEnforced" }, "operations": [ { diff --git a/test/connection_monitoring/pool-checkout-maxConnecting-timeout.json b/test/connection_monitoring/pool-checkout-maxConnecting-timeout.json index 4d9fda1a68..443104675d 100644 --- a/test/connection_monitoring/pool-checkout-maxConnecting-timeout.json +++ b/test/connection_monitoring/pool-checkout-maxConnecting-timeout.json @@ -19,12 +19,14 @@ ], "closeConnection": false, "blockConnection": true, - "blockTimeMS": 750 + "blockTimeMS": 750, + "appName": "PoolCheckoutMaxConnectingTimeout" } }, "poolOptions": { "maxPoolSize": 10, - "waitQueueTimeoutMS": 50 + "waitQueueTimeoutMS": 50, + "appName": "PoolCheckoutMaxConnectingTimeout" }, "operations": [ { diff --git a/test/connection_monitoring/pool-checkout-minPoolSize-connection-maxConnecting.json b/test/connection_monitoring/pool-checkout-minPoolSize-connection-maxConnecting.json index 3b0d43e877..b53b002805 100644 --- a/test/connection_monitoring/pool-checkout-minPoolSize-connection-maxConnecting.json +++ b/test/connection_monitoring/pool-checkout-minPoolSize-connection-maxConnecting.json @@ -17,13 +17,15 @@ ], "closeConnection": false, "blockConnection": true, - "blockTimeMS": 500 + "blockTimeMS": 500, + "appName": "PoolCheckoutMinPoolSizeConnectionMaxConnecting" } }, "poolOptions": { "minPoolSize": 2, "maxPoolSize": 3, - "waitQueueTimeoutMS": 5000 + "waitQueueTimeoutMS": 5000, + "appName": "PoolCheckoutMinPoolSizeConnectionMaxConnecting" }, "operations": [ { diff --git a/test/connection_monitoring/pool-checkout-returned-connection-maxConnecting.json b/test/connection_monitoring/pool-checkout-returned-connection-maxConnecting.json index 10b526e0c3..0bac21ae64 100644 --- a/test/connection_monitoring/pool-checkout-returned-connection-maxConnecting.json +++ b/test/connection_monitoring/pool-checkout-returned-connection-maxConnecting.json @@ -19,13 +19,15 @@ ], "closeConnection": false, "blockConnection": true, - "blockTimeMS": 750 + "blockTimeMS": 750, + "appName": "PoolCheckoutReturnedConnectionMaxConnecting" } }, "poolOptions": { "maxConnecting": 2, "maxPoolSize": 10, - "waitQueueTimeoutMS": 5000 + "waitQueueTimeoutMS": 5000, + "appName": "PoolCheckoutReturnedConnectionMaxConnecting" }, "operations": [ { diff --git a/test/connection_monitoring/pool-clear-interrupting-pending-connections.json b/test/connection_monitoring/pool-clear-interrupting-pending-connections.json index c1fd746329..a8452d8f84 100644 --- a/test/connection_monitoring/pool-clear-interrupting-pending-connections.json +++ b/test/connection_monitoring/pool-clear-interrupting-pending-connections.json @@ -17,11 +17,13 @@ ], "closeConnection": false, "blockConnection": true, - "blockTimeMS": 10000 + "blockTimeMS": 10000, + "appName": "PoolClearInterruptingPendingConnections" } }, "poolOptions": { - "minPoolSize": 0 + "minPoolSize": 0, + "appName": "PoolClearInterruptingPendingConnections" }, "operations": [ { diff --git a/test/load_balancer/cursors.json b/test/load_balancer/cursors.json index 27aaddd5b6..b11bf2c6fa 100644 --- a/test/load_balancer/cursors.json +++ b/test/load_balancer/cursors.json @@ -385,7 +385,7 @@ ] }, { - "description": "pinned connections are returned after an network error during getMore", + "description": "pinned connections are not returned after an network error during getMore", "operations": [ { "name": "failPoint", @@ -449,7 +449,7 @@ "object": "testRunner", "arguments": { "client": "client0", - "connections": 0 + "connections": 1 } }, { @@ -677,7 +677,7 @@ ] }, { - "description": "pinned connections are returned to the pool after a non-network error on getMore", + "description": "pinned connections are not returned to the pool after a non-network error on getMore", "operations": [ { "name": "failPoint", @@ -733,7 +733,7 @@ "object": "testRunner", "arguments": { "client": "client0", - "connections": 0 + "connections": 1 } }, { diff --git a/test/load_balancer/sdam-error-handling.json b/test/load_balancer/sdam-error-handling.json index 41bc90be7f..2107afe5b3 100644 --- a/test/load_balancer/sdam-error-handling.json +++ b/test/load_balancer/sdam-error-handling.json @@ -372,6 +372,9 @@ { "connectionCreatedEvent": {} }, + { + "poolClearedEvent": {} + }, { "connectionClosedEvent": { "reason": "error" @@ -381,9 +384,6 @@ "connectionCheckOutFailedEvent": { "reason": "connectionError" } - }, - { - "poolClearedEvent": {} } ] } diff --git a/test/server_selection_logging/operation-id.json b/test/server_selection_logging/operation-id.json index ccc2623166..72ebff60d8 100644 --- a/test/server_selection_logging/operation-id.json +++ b/test/server_selection_logging/operation-id.json @@ -197,7 +197,7 @@ } }, { - "level": "debug", + "level": "info", "component": "serverSelection", "data": { "message": "Waiting for suitable server to become available", @@ -383,7 +383,7 @@ } }, { - "level": "debug", + "level": "info", "component": "serverSelection", "data": { "message": "Waiting for suitable server to become available", diff --git a/test/server_selection_logging/replica-set.json b/test/server_selection_logging/replica-set.json index 830b1ea51a..5eba784bf2 100644 --- a/test/server_selection_logging/replica-set.json +++ b/test/server_selection_logging/replica-set.json @@ -184,7 +184,7 @@ } }, { - "level": "debug", + "level": "info", "component": "serverSelection", "data": { "message": "Waiting for suitable server to become available", diff --git a/test/server_selection_logging/sharded.json b/test/server_selection_logging/sharded.json index 346c050f9e..d42fba9100 100644 --- a/test/server_selection_logging/sharded.json +++ b/test/server_selection_logging/sharded.json @@ -193,7 +193,7 @@ } }, { - "level": "debug", + "level": "info", "component": "serverSelection", "data": { "message": "Waiting for suitable server to become available", diff --git a/test/server_selection_logging/standalone.json b/test/server_selection_logging/standalone.json index fa01ad9911..3b3eddd841 100644 --- a/test/server_selection_logging/standalone.json +++ b/test/server_selection_logging/standalone.json @@ -191,7 +191,7 @@ } }, { - "level": "debug", + "level": "info", "component": "serverSelection", "data": { "message": "Waiting for suitable server to become available", diff --git a/test/transactions-convenient-api/unified/callback-aborts.json b/test/transactions-convenient-api/unified/callback-aborts.json index 206428715c..dc8f7fb5a4 100644 --- a/test/transactions-convenient-api/unified/callback-aborts.json +++ b/test/transactions-convenient-api/unified/callback-aborts.json @@ -308,10 +308,12 @@ "lsid": { "$$sessionLsid": "session0" }, - "autocommit": { - "$$exists": false - }, "readConcern": { + "afterClusterTime": { + "$$exists": true + } + }, + "autocommit": { "$$exists": false }, "startTransaction": { diff --git a/test/transactions-convenient-api/unified/callback-commits.json b/test/transactions-convenient-api/unified/callback-commits.json index 06f791e9ae..edda386418 100644 --- a/test/transactions-convenient-api/unified/callback-commits.json +++ b/test/transactions-convenient-api/unified/callback-commits.json @@ -381,10 +381,12 @@ "lsid": { "$$sessionLsid": "session0" }, - "autocommit": { - "$$exists": false - }, "readConcern": { + "afterClusterTime": { + "$$exists": true + } + }, + "autocommit": { "$$exists": false }, "startTransaction": { diff --git a/test/transactions/unified/commit.json b/test/transactions/unified/commit.json index ab778d8df2..f033906940 100644 --- a/test/transactions/unified/commit.json +++ b/test/transactions/unified/commit.json @@ -1040,7 +1040,9 @@ ], "ordered": true, "readConcern": { - "$$exists": false + "afterClusterTime": { + "$$exists": true + } }, "lsid": { "$$sessionLsid": "session1" @@ -1196,7 +1198,9 @@ ], "ordered": true, "readConcern": { - "$$exists": false + "afterClusterTime": { + "$$exists": true + } }, "lsid": { "$$sessionLsid": "session1" diff --git a/test/transactions/unified/retryable-writes.json b/test/transactions/unified/retryable-writes.json index c196e68622..21ef22b8ab 100644 --- a/test/transactions/unified/retryable-writes.json +++ b/test/transactions/unified/retryable-writes.json @@ -217,7 +217,9 @@ ], "ordered": true, "readConcern": { - "$$exists": false + "afterClusterTime": { + "$$exists": true + } }, "lsid": { "$$sessionLsid": "session0" @@ -306,7 +308,9 @@ ], "ordered": true, "readConcern": { - "$$exists": false + "afterClusterTime": { + "$$exists": true + } }, "lsid": { "$$sessionLsid": "session0" From 3dc8b6f4afd231bb3e7965796ee493f1ccd16ae8 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 3 Jun 2026 07:37:24 -0500 Subject: [PATCH 2/3] Fix spec resync patch handling and add PYTHON-5809 patch - Fix apply_patches to glob *.patch files only (not directories) so the permanent/ subdirectory no longer breaks git apply - Include permanent/*.patch in the patch list - Remove incorrect -R flag; all patches are forward patches - Add PYTHON-5809.patch to revert afterClusterTime readConcern changes in transaction tests that PyMongo does not yet implement - Revert load_balancer, server_selection_logging, and transaction test changes from upstream; these are handled by existing permanent patches and the new PYTHON-5809 patch respectively --- .evergreen/scripts/resync-all-specs.py | 5 +- .evergreen/spec-patch/PYTHON-5809.patch | 97 +++++++++++++++++++ test/load_balancer/cursors.json | 8 +- test/load_balancer/sdam-error-handling.json | 6 +- .../operation-id.json | 4 +- .../server_selection_logging/replica-set.json | 2 +- test/server_selection_logging/sharded.json | 2 +- test/server_selection_logging/standalone.json | 2 +- .../unified/callback-aborts.json | 8 +- .../unified/callback-commits.json | 8 +- test/transactions/unified/commit.json | 8 +- .../unified/retryable-writes.json | 8 +- 12 files changed, 122 insertions(+), 36 deletions(-) create mode 100644 .evergreen/spec-patch/PYTHON-5809.patch diff --git a/.evergreen/scripts/resync-all-specs.py b/.evergreen/scripts/resync-all-specs.py index 16782de9a8..9886650a9d 100644 --- a/.evergreen/scripts/resync-all-specs.py +++ b/.evergreen/scripts/resync-all-specs.py @@ -40,13 +40,14 @@ def apply_patches(errored): try: # Avoid shell=True by passing arguments as a list. # Note: glob expansion doesn't work in shell=False, so we use a list of files. - patches = [str(p) for p in pathlib.Path("./.evergreen/spec-patch/").glob("*")] + spec_patch_dir = pathlib.Path("./.evergreen/spec-patch/") + patches = [str(p) for p in spec_patch_dir.glob("*.patch")] + patches += [str(p) for p in spec_patch_dir.glob("permanent/*.patch")] if patches: subprocess.run( [ # noqa: S603, S607 "git", "apply", - "-R", "--allow-empty", "--whitespace=fix", *patches, diff --git a/.evergreen/spec-patch/PYTHON-5809.patch b/.evergreen/spec-patch/PYTHON-5809.patch new file mode 100644 index 0000000000..22b2289782 --- /dev/null +++ b/.evergreen/spec-patch/PYTHON-5809.patch @@ -0,0 +1,97 @@ +PYMONGO DOES NOT IMPLEMENT afterClusterTime IN readConcern FOR TRANSACTIONS -- WE NEED THIS PATCH +diff --git a/test/transactions-convenient-api/unified/callback-aborts.json b/test/transactions-convenient-api/unified/callback-aborts.json +index dc8f7fb5..20642871 100644 +--- a/test/transactions-convenient-api/unified/callback-aborts.json ++++ b/test/transactions-convenient-api/unified/callback-aborts.json +@@ -308,14 +308,12 @@ + "lsid": { + "$$sessionLsid": "session0" + }, +- "readConcern": { +- "afterClusterTime": { +- "$$exists": true +- } +- }, + "autocommit": { + "$$exists": false + }, ++ "readConcern": { ++ "$$exists": false ++ }, + "startTransaction": { + "$$exists": false + }, +diff --git a/test/transactions-convenient-api/unified/callback-commits.json b/test/transactions-convenient-api/unified/callback-commits.json +index edda3864..06f791e9 100644 +--- a/test/transactions-convenient-api/unified/callback-commits.json ++++ b/test/transactions-convenient-api/unified/callback-commits.json +@@ -381,14 +381,12 @@ + "lsid": { + "$$sessionLsid": "session0" + }, +- "readConcern": { +- "afterClusterTime": { +- "$$exists": true +- } +- }, + "autocommit": { + "$$exists": false + }, ++ "readConcern": { ++ "$$exists": false ++ }, + "startTransaction": { + "$$exists": false + }, +diff --git a/test/transactions/unified/commit.json b/test/transactions/unified/commit.json +index f0339069..ab778d8d 100644 +--- a/test/transactions/unified/commit.json ++++ b/test/transactions/unified/commit.json +@@ -1040,9 +1040,7 @@ + ], + "ordered": true, + "readConcern": { +- "afterClusterTime": { +- "$$exists": true +- } ++ "$$exists": false + }, + "lsid": { + "$$sessionLsid": "session1" +@@ -1198,9 +1196,7 @@ + ], + "ordered": true, + "readConcern": { +- "afterClusterTime": { +- "$$exists": true +- } ++ "$$exists": false + }, + "lsid": { + "$$sessionLsid": "session1" +diff --git a/test/transactions/unified/retryable-writes.json b/test/transactions/unified/retryable-writes.json +index 21ef22b8..c196e686 100644 +--- a/test/transactions/unified/retryable-writes.json ++++ b/test/transactions/unified/retryable-writes.json +@@ -217,9 +217,7 @@ + ], + "ordered": true, + "readConcern": { +- "afterClusterTime": { +- "$$exists": true +- } ++ "$$exists": false + }, + "lsid": { + "$$sessionLsid": "session0" +@@ -308,9 +306,7 @@ + ], + "ordered": true, + "readConcern": { +- "afterClusterTime": { +- "$$exists": true +- } ++ "$$exists": false + }, + "lsid": { + "$$sessionLsid": "session0" diff --git a/test/load_balancer/cursors.json b/test/load_balancer/cursors.json index b11bf2c6fa..27aaddd5b6 100644 --- a/test/load_balancer/cursors.json +++ b/test/load_balancer/cursors.json @@ -385,7 +385,7 @@ ] }, { - "description": "pinned connections are not returned after an network error during getMore", + "description": "pinned connections are returned after an network error during getMore", "operations": [ { "name": "failPoint", @@ -449,7 +449,7 @@ "object": "testRunner", "arguments": { "client": "client0", - "connections": 1 + "connections": 0 } }, { @@ -677,7 +677,7 @@ ] }, { - "description": "pinned connections are not returned to the pool after a non-network error on getMore", + "description": "pinned connections are returned to the pool after a non-network error on getMore", "operations": [ { "name": "failPoint", @@ -733,7 +733,7 @@ "object": "testRunner", "arguments": { "client": "client0", - "connections": 1 + "connections": 0 } }, { diff --git a/test/load_balancer/sdam-error-handling.json b/test/load_balancer/sdam-error-handling.json index 2107afe5b3..41bc90be7f 100644 --- a/test/load_balancer/sdam-error-handling.json +++ b/test/load_balancer/sdam-error-handling.json @@ -372,9 +372,6 @@ { "connectionCreatedEvent": {} }, - { - "poolClearedEvent": {} - }, { "connectionClosedEvent": { "reason": "error" @@ -384,6 +381,9 @@ "connectionCheckOutFailedEvent": { "reason": "connectionError" } + }, + { + "poolClearedEvent": {} } ] } diff --git a/test/server_selection_logging/operation-id.json b/test/server_selection_logging/operation-id.json index 72ebff60d8..ccc2623166 100644 --- a/test/server_selection_logging/operation-id.json +++ b/test/server_selection_logging/operation-id.json @@ -197,7 +197,7 @@ } }, { - "level": "info", + "level": "debug", "component": "serverSelection", "data": { "message": "Waiting for suitable server to become available", @@ -383,7 +383,7 @@ } }, { - "level": "info", + "level": "debug", "component": "serverSelection", "data": { "message": "Waiting for suitable server to become available", diff --git a/test/server_selection_logging/replica-set.json b/test/server_selection_logging/replica-set.json index 5eba784bf2..830b1ea51a 100644 --- a/test/server_selection_logging/replica-set.json +++ b/test/server_selection_logging/replica-set.json @@ -184,7 +184,7 @@ } }, { - "level": "info", + "level": "debug", "component": "serverSelection", "data": { "message": "Waiting for suitable server to become available", diff --git a/test/server_selection_logging/sharded.json b/test/server_selection_logging/sharded.json index d42fba9100..346c050f9e 100644 --- a/test/server_selection_logging/sharded.json +++ b/test/server_selection_logging/sharded.json @@ -193,7 +193,7 @@ } }, { - "level": "info", + "level": "debug", "component": "serverSelection", "data": { "message": "Waiting for suitable server to become available", diff --git a/test/server_selection_logging/standalone.json b/test/server_selection_logging/standalone.json index 3b3eddd841..fa01ad9911 100644 --- a/test/server_selection_logging/standalone.json +++ b/test/server_selection_logging/standalone.json @@ -191,7 +191,7 @@ } }, { - "level": "info", + "level": "debug", "component": "serverSelection", "data": { "message": "Waiting for suitable server to become available", diff --git a/test/transactions-convenient-api/unified/callback-aborts.json b/test/transactions-convenient-api/unified/callback-aborts.json index dc8f7fb5a4..206428715c 100644 --- a/test/transactions-convenient-api/unified/callback-aborts.json +++ b/test/transactions-convenient-api/unified/callback-aborts.json @@ -308,14 +308,12 @@ "lsid": { "$$sessionLsid": "session0" }, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, "autocommit": { "$$exists": false }, + "readConcern": { + "$$exists": false + }, "startTransaction": { "$$exists": false }, diff --git a/test/transactions-convenient-api/unified/callback-commits.json b/test/transactions-convenient-api/unified/callback-commits.json index edda386418..06f791e9ae 100644 --- a/test/transactions-convenient-api/unified/callback-commits.json +++ b/test/transactions-convenient-api/unified/callback-commits.json @@ -381,14 +381,12 @@ "lsid": { "$$sessionLsid": "session0" }, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, "autocommit": { "$$exists": false }, + "readConcern": { + "$$exists": false + }, "startTransaction": { "$$exists": false }, diff --git a/test/transactions/unified/commit.json b/test/transactions/unified/commit.json index f033906940..ab778d8df2 100644 --- a/test/transactions/unified/commit.json +++ b/test/transactions/unified/commit.json @@ -1040,9 +1040,7 @@ ], "ordered": true, "readConcern": { - "afterClusterTime": { - "$$exists": true - } + "$$exists": false }, "lsid": { "$$sessionLsid": "session1" @@ -1198,9 +1196,7 @@ ], "ordered": true, "readConcern": { - "afterClusterTime": { - "$$exists": true - } + "$$exists": false }, "lsid": { "$$sessionLsid": "session1" diff --git a/test/transactions/unified/retryable-writes.json b/test/transactions/unified/retryable-writes.json index 21ef22b8ab..c196e68622 100644 --- a/test/transactions/unified/retryable-writes.json +++ b/test/transactions/unified/retryable-writes.json @@ -217,9 +217,7 @@ ], "ordered": true, "readConcern": { - "afterClusterTime": { - "$$exists": true - } + "$$exists": false }, "lsid": { "$$sessionLsid": "session0" @@ -308,9 +306,7 @@ ], "ordered": true, "readConcern": { - "afterClusterTime": { - "$$exists": true - } + "$$exists": false }, "lsid": { "$$sessionLsid": "session0" From c7a43bf25e46490e41032944e022ca815f10e229 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 3 Jun 2026 09:40:04 -0500 Subject: [PATCH 3/3] Fix test_maxtime_ms_message for newer MongoDB WASM JS execution Newer MongoDB executes $where in WASM and returns Interrupted (11601) instead of MaxTimeMSExpired (50) when max_time_ms kills the execution. PyMongo only appends the configured timeout details for code 50, so the assertIn check was failing. Make the assertion conditional on the error being an ExecutionTimeout (code 50). --- test/asynchronous/test_cursor.py | 13 +++++++++---- test/test_cursor.py | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/test/asynchronous/test_cursor.py b/test/asynchronous/test_cursor.py index 08da82762c..95604f65df 100644 --- a/test/asynchronous/test_cursor.py +++ b/test/asynchronous/test_cursor.py @@ -203,17 +203,22 @@ async def test_max_time_ms(self): async def test_maxtime_ms_message(self): db = self.db await db.t.insert_one({"x": 1}) - with self.assertRaises(Exception) as error: + with self.assertRaises(OperationFailure) as error: await db.t.find_one({"$where": delay(2)}, max_time_ms=1) - self.assertIn("(configured timeouts: connectTimeoutMS: 20000.0ms", str(error.exception)) + # Newer MongoDB executes $where in WASM and returns Interrupted (11601) instead + # of MaxTimeMSExpired (50) when max_time_ms kills execution; only MaxTimeMSExpired + # errors get the configured timeout details appended. + if isinstance(error.exception, ExecutionTimeout): + self.assertIn("(configured timeouts: connectTimeoutMS: 20000.0ms", str(error.exception)) client = await self.async_rs_client(document_class=RawBSONDocument) await client.db.t.insert_one({"x": 1}) - with self.assertRaises(Exception) as error: + with self.assertRaises(OperationFailure) as error: await client.db.t.find_one({"$where": delay(2)}, max_time_ms=1) - self.assertIn("(configured timeouts: connectTimeoutMS: 20000.0ms", str(error.exception)) + if isinstance(error.exception, ExecutionTimeout): + self.assertIn("(configured timeouts: connectTimeoutMS: 20000.0ms", str(error.exception)) async def test_max_await_time_ms(self): db = self.db diff --git a/test/test_cursor.py b/test/test_cursor.py index b63638bfab..cd13e9bfff 100644 --- a/test/test_cursor.py +++ b/test/test_cursor.py @@ -201,17 +201,22 @@ def test_max_time_ms(self): def test_maxtime_ms_message(self): db = self.db db.t.insert_one({"x": 1}) - with self.assertRaises(Exception) as error: + with self.assertRaises(OperationFailure) as error: db.t.find_one({"$where": delay(2)}, max_time_ms=1) - self.assertIn("(configured timeouts: connectTimeoutMS: 20000.0ms", str(error.exception)) + # Newer MongoDB executes $where in WASM and returns Interrupted (11601) instead + # of MaxTimeMSExpired (50) when max_time_ms kills execution; only MaxTimeMSExpired + # errors get the configured timeout details appended. + if isinstance(error.exception, ExecutionTimeout): + self.assertIn("(configured timeouts: connectTimeoutMS: 20000.0ms", str(error.exception)) client = self.rs_client(document_class=RawBSONDocument) client.db.t.insert_one({"x": 1}) - with self.assertRaises(Exception) as error: + with self.assertRaises(OperationFailure) as error: client.db.t.find_one({"$where": delay(2)}, max_time_ms=1) - self.assertIn("(configured timeouts: connectTimeoutMS: 20000.0ms", str(error.exception)) + if isinstance(error.exception, ExecutionTimeout): + self.assertIn("(configured timeouts: connectTimeoutMS: 20000.0ms", str(error.exception)) def test_max_await_time_ms(self): db = self.db