Skip to content

Commit 66a7074

Browse files
committed
PYTHON-2729 PYTHON-2721 PYTHON-2730 Make 5.0 tests green (#626)
Update explain response format parsing for 5.0. Temporarily skip failing regex and killCursors tests on 5.0. (cherry picked from commit 21c92b1)
1 parent 0cbd7a2 commit 66a7074

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

test/command_monitoring/find.json

+1
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@
415415
{
416416
"description": "A successful find event with a getmore and the server kills the cursor",
417417
"ignore_if_server_version_less_than": "3.1",
418+
"ignore_if_server_version_greater_than": "4.9.0",
418419
"ignore_if_topology_type": [
419420
"sharded"
420421
],

test/test_collection.py

+4
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,9 @@ def get_plan_stage(self, root, stage):
619619
stage = self.get_plan_stage(i, stage)
620620
if stage:
621621
return stage
622+
elif "queryPlan" in root:
623+
# queryPlan (and slotBasedPlan) are new in 5.0.
624+
return self.get_plan_stage(root["queryPlan"], stage)
622625
elif "shards" in root:
623626
for i in root['shards']:
624627
stage = self.get_plan_stage(i['winningPlan'], stage)
@@ -1182,6 +1185,7 @@ def test_fields_specifier_as_dict(self):
11821185
self.assertTrue("x" not in db.test.find_one(projection={"x": 0}))
11831186
self.assertTrue("mike" in db.test.find_one(projection={"x": 0}))
11841187

1188+
@client_context.require_version_max(4, 9, -1) # PYTHON-2721
11851189
def test_find_w_regex(self):
11861190
db = self.db
11871191
db.test.delete_many({})

test/unified-test-format/valid-pass/poc-command-monitoring.json

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"runOnRequirements": [
6262
{
6363
"minServerVersion": "3.1",
64+
"maxServerVersion": "4.9.0",
6465
"topologies": [
6566
"single",
6667
"replicaset"

0 commit comments

Comments
 (0)