Skip to content

Commit 9a9a65c

Browse files
authored
PYTHON-5496 Update CSOT tests for change in dropIndex behavior in 8.3 (#2498)
1 parent f7b94be commit 9a9a65c

File tree

6 files changed

+183
-30
lines changed

6 files changed

+183
-30
lines changed

test/asynchronous/unified_format.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,6 @@ def maybe_skip_test(self, spec):
591591
self.skipTest("CSOT not implemented for watch()")
592592
if "cursors" in class_name:
593593
self.skipTest("CSOT not implemented for cursors")
594-
if "dropindex on collection" in description:
595-
self.skipTest("PYTHON-5491")
596594
if (
597595
"tailable" in class_name
598596
or "tailable" in description

test/csot/deprecated-options.json

Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6750,16 +6750,23 @@
67506750
}
67516751
}
67526752
},
6753+
{
6754+
"name": "createIndex",
6755+
"object": "collection",
6756+
"arguments": {
6757+
"keys": {
6758+
"x": 1
6759+
},
6760+
"timeoutMS": 100000,
6761+
"name": "x_1"
6762+
}
6763+
},
67536764
{
67546765
"name": "dropIndex",
67556766
"object": "collection",
67566767
"arguments": {
67576768
"timeoutMS": 100000,
67586769
"name": "x_1"
6759-
},
6760-
"expectError": {
6761-
"isClientError": false,
6762-
"isTimeoutError": false
67636770
}
67646771
}
67656772
]
@@ -6815,23 +6822,36 @@
68156822
]
68166823
}
68176824
},
6825+
{
6826+
"name": "createIndex",
6827+
"object": "collection",
6828+
"arguments": {
6829+
"keys": {
6830+
"x": 1
6831+
},
6832+
"timeoutMS": 100000,
6833+
"name": "x_1"
6834+
}
6835+
},
68186836
{
68196837
"name": "dropIndex",
68206838
"object": "collection",
68216839
"arguments": {
68226840
"timeoutMS": 100000,
68236841
"name": "x_1"
6824-
},
6825-
"expectError": {
6826-
"isClientError": false,
6827-
"isTimeoutError": false
68286842
}
68296843
}
68306844
],
68316845
"expectEvents": [
68326846
{
68336847
"client": "client",
68346848
"events": [
6849+
{
6850+
"commandStartedEvent": {
6851+
"commandName": "createIndexes",
6852+
"databaseName": "test"
6853+
}
6854+
},
68356855
{
68366856
"commandStartedEvent": {
68376857
"commandName": "dropIndexes",
@@ -6903,24 +6923,36 @@
69036923
]
69046924
}
69056925
},
6926+
{
6927+
"name": "createIndex",
6928+
"object": "collection",
6929+
"arguments": {
6930+
"keys": {
6931+
"x": 1
6932+
},
6933+
"name": "x_1"
6934+
}
6935+
},
69066936
{
69076937
"name": "dropIndex",
69086938
"object": "collection",
69096939
"arguments": {
69106940
"timeoutMS": 1000,
69116941
"maxTimeMS": 5000,
69126942
"name": "x_1"
6913-
},
6914-
"expectError": {
6915-
"isClientError": false,
6916-
"isTimeoutError": false
69176943
}
69186944
}
69196945
],
69206946
"expectEvents": [
69216947
{
69226948
"client": "client",
69236949
"events": [
6950+
{
6951+
"commandStartedEvent": {
6952+
"commandName": "createIndexes",
6953+
"databaseName": "test"
6954+
}
6955+
},
69246956
{
69256957
"commandStartedEvent": {
69266958
"commandName": "dropIndexes",
@@ -7003,6 +7035,17 @@
70037035
}
70047036
}
70057037
},
7038+
{
7039+
"name": "createIndex",
7040+
"object": "collection",
7041+
"arguments": {
7042+
"keys": {
7043+
"x": 1
7044+
},
7045+
"name": "x_1",
7046+
"timeoutMS": 100000
7047+
}
7048+
},
70067049
{
70077050
"name": "dropIndexes",
70087051
"object": "collection",

test/csot/global-timeoutMS.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5621,22 +5621,34 @@
56215621
}
56225622
}
56235623
},
5624+
{
5625+
"name": "createIndex",
5626+
"object": "collection",
5627+
"arguments": {
5628+
"keys": {
5629+
"x": 1
5630+
},
5631+
"name": "x_1"
5632+
}
5633+
},
56245634
{
56255635
"name": "dropIndex",
56265636
"object": "collection",
56275637
"arguments": {
56285638
"name": "x_1"
5629-
},
5630-
"expectError": {
5631-
"isClientError": false,
5632-
"isTimeoutError": false
56335639
}
56345640
}
56355641
],
56365642
"expectEvents": [
56375643
{
56385644
"client": "client",
56395645
"events": [
5646+
{
5647+
"commandStartedEvent": {
5648+
"commandName": "createIndexes",
5649+
"databaseName": "test"
5650+
}
5651+
},
56405652
{
56415653
"commandStartedEvent": {
56425654
"commandName": "dropIndexes",

test/csot/override-operation-timeoutMS.json

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3378,22 +3378,36 @@
33783378
}
33793379
}
33803380
},
3381+
{
3382+
"name": "createIndex",
3383+
"object": "collection",
3384+
"arguments": {
3385+
"keys": {
3386+
"x": 1
3387+
},
3388+
"timeoutMS": 1000,
3389+
"name": "x_1"
3390+
}
3391+
},
33813392
{
33823393
"name": "dropIndex",
33833394
"object": "collection",
33843395
"arguments": {
33853396
"timeoutMS": 1000,
33863397
"name": "x_1"
3387-
},
3388-
"expectError": {
3389-
"isTimeoutError": false
33903398
}
33913399
}
33923400
],
33933401
"expectEvents": [
33943402
{
33953403
"client": "client",
33963404
"events": [
3405+
{
3406+
"commandStartedEvent": {
3407+
"commandName": "createIndexes",
3408+
"databaseName": "test"
3409+
}
3410+
},
33973411
{
33983412
"commandStartedEvent": {
33993413
"commandName": "dropIndexes",
@@ -3436,22 +3450,36 @@
34363450
}
34373451
}
34383452
},
3453+
{
3454+
"name": "createIndex",
3455+
"object": "collection",
3456+
"arguments": {
3457+
"keys": {
3458+
"x": 1
3459+
},
3460+
"timeoutMS": 0,
3461+
"name": "x_1"
3462+
}
3463+
},
34393464
{
34403465
"name": "dropIndex",
34413466
"object": "collection",
34423467
"arguments": {
34433468
"timeoutMS": 0,
34443469
"name": "x_1"
3445-
},
3446-
"expectError": {
3447-
"isTimeoutError": false
34483470
}
34493471
}
34503472
],
34513473
"expectEvents": [
34523474
{
34533475
"client": "client",
34543476
"events": [
3477+
{
3478+
"commandStartedEvent": {
3479+
"commandName": "createIndexes",
3480+
"databaseName": "test"
3481+
}
3482+
},
34553483
{
34563484
"commandStartedEvent": {
34573485
"commandName": "dropIndexes",

test/csot/tailable-awaitData.json

Lines changed: 78 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
]
7979
},
8080
{
81-
"description": "error if maxAwaitTimeMS is greater than timeoutMS",
81+
"description": "error on find if maxAwaitTimeMS is greater than timeoutMS",
8282
"operations": [
8383
{
8484
"name": "find",
@@ -90,13 +90,50 @@
9090
"maxAwaitTimeMS": 10
9191
},
9292
"expectError": {
93-
"isClientError": true
93+
"isClientError": true,
94+
"isTimeoutError": false
95+
}
96+
}
97+
]
98+
},
99+
{
100+
"description": "error on aggregate if maxAwaitTimeMS is greater than timeoutMS",
101+
"operations": [
102+
{
103+
"name": "aggregate",
104+
"object": "collection",
105+
"arguments": {
106+
"pipeline": [],
107+
"timeoutMS": 5,
108+
"maxAwaitTimeMS": 10
109+
},
110+
"expectError": {
111+
"isClientError": true,
112+
"isTimeoutError": false
113+
}
114+
}
115+
]
116+
},
117+
{
118+
"description": "error on watch if maxAwaitTimeMS is greater than timeoutMS",
119+
"operations": [
120+
{
121+
"name": "createChangeStream",
122+
"object": "collection",
123+
"arguments": {
124+
"pipeline": [],
125+
"timeoutMS": 5,
126+
"maxAwaitTimeMS": 10
127+
},
128+
"expectError": {
129+
"isClientError": true,
130+
"isTimeoutError": false
94131
}
95132
}
96133
]
97134
},
98135
{
99-
"description": "error if maxAwaitTimeMS is equal to timeoutMS",
136+
"description": "error on find if maxAwaitTimeMS is equal to timeoutMS",
100137
"operations": [
101138
{
102139
"name": "find",
@@ -108,7 +145,44 @@
108145
"maxAwaitTimeMS": 5
109146
},
110147
"expectError": {
111-
"isClientError": true
148+
"isClientError": true,
149+
"isTimeoutError": false
150+
}
151+
}
152+
]
153+
},
154+
{
155+
"description": "error on aggregate if maxAwaitTimeMS is equal to timeoutMS",
156+
"operations": [
157+
{
158+
"name": "aggregate",
159+
"object": "collection",
160+
"arguments": {
161+
"pipeline": [],
162+
"timeoutMS": 5,
163+
"maxAwaitTimeMS": 5
164+
},
165+
"expectError": {
166+
"isClientError": true,
167+
"isTimeoutError": false
168+
}
169+
}
170+
]
171+
},
172+
{
173+
"description": "error on watch if maxAwaitTimeMS is equal to timeoutMS",
174+
"operations": [
175+
{
176+
"name": "createChangeStream",
177+
"object": "collection",
178+
"arguments": {
179+
"pipeline": [],
180+
"timeoutMS": 5,
181+
"maxAwaitTimeMS": 5
182+
},
183+
"expectError": {
184+
"isClientError": true,
185+
"isTimeoutError": false
112186
}
113187
}
114188
]

test/unified_format.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,8 +590,6 @@ def maybe_skip_test(self, spec):
590590
self.skipTest("CSOT not implemented for watch()")
591591
if "cursors" in class_name:
592592
self.skipTest("CSOT not implemented for cursors")
593-
if "dropindex on collection" in description:
594-
self.skipTest("PYTHON-5491")
595593
if (
596594
"tailable" in class_name
597595
or "tailable" in description

0 commit comments

Comments
 (0)