Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .evergreen/scripts/resync-all-specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("*")]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a bug fix. We weren't properly applying patches from the permanent folder.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad 🤦 thanks for catching that!

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,
Expand Down
97 changes: 97 additions & 0 deletions .evergreen/spec-patch/PYTHON-5809.patch
Original file line number Diff line number Diff line change
@@ -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"
13 changes: 9 additions & 4 deletions test/asynchronous/test_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -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
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
],
"closeConnection": false,
"blockConnection": true,
"blockTimeMS": 800
"blockTimeMS": 800,
"appName": "PoolCheckoutMaxConnectingIsEnforced"
}
},
"poolOptions": {
"maxPoolSize": 10,
"waitQueueTimeoutMS": 5000
"waitQueueTimeoutMS": 5000,
"appName": "PoolCheckoutMaxConnectingIsEnforced"
},
"operations": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
],
"closeConnection": false,
"blockConnection": true,
"blockTimeMS": 750
"blockTimeMS": 750,
"appName": "PoolCheckoutMaxConnectingTimeout"
}
},
"poolOptions": {
"maxPoolSize": 10,
"waitQueueTimeoutMS": 50
"waitQueueTimeoutMS": 50,
"appName": "PoolCheckoutMaxConnectingTimeout"
},
"operations": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
],
"closeConnection": false,
"blockConnection": true,
"blockTimeMS": 10000
"blockTimeMS": 10000,
"appName": "PoolClearInterruptingPendingConnections"
}
},
"poolOptions": {
"minPoolSize": 0
"minPoolSize": 0,
"appName": "PoolClearInterruptingPendingConnections"
},
"operations": [
{
Expand Down
13 changes: 9 additions & 4 deletions test/test_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading