Skip to content

Commit 1ea3a41

Browse files
test(NODE-7110): update csot tests for drop index (#4621)
Co-authored-by: bailey <[email protected]>
1 parent e4492f3 commit 1ea3a41

10 files changed

+292
-82
lines changed

test/spec/client-side-operations-timeout/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/spec/client-side-operations-timeout/deprecated-options.yml

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3743,16 +3743,19 @@ tests:
37433743
failCommands: ["dropIndexes"]
37443744
blockConnection: true
37453745
blockTimeMS: 5
3746+
# Create the index first so dropIndex doesn't return IndexNotFound on
3747+
# servers prior to 8.3.
3748+
- name: createIndex
3749+
object: *collection
3750+
arguments:
3751+
keys: { x: 1 }
3752+
timeoutMS: 100000
3753+
name: "x_1"
37463754
- name: dropIndex
37473755
object: *collection
37483756
arguments:
37493757
timeoutMS: 100000
37503758
name: "x_1"
3751-
3752-
expectError:
3753-
isClientError: false
3754-
isTimeoutError: false
3755-
37563759
- description: "wTimeoutMS is ignored if timeoutMS is set - dropIndex on collection"
37573760
operations:
37583761
- name: createEntities
@@ -3781,18 +3784,26 @@ tests:
37813784
- session:
37823785
id: &session session
37833786
client: *client
3787+
# Create the index first so dropIndex doesn't return IndexNotFound on
3788+
# servers prior to 8.3.
3789+
- name: createIndex
3790+
object: *collection
3791+
arguments:
3792+
keys: { x: 1 }
3793+
timeoutMS: 100000
3794+
name: "x_1"
37843795
- name: dropIndex
37853796
object: *collection
37863797
arguments:
37873798
timeoutMS: 100000
37883799
name: "x_1"
3789-
3790-
expectError:
3791-
isClientError: false
3792-
isTimeoutError: false
37933800
expectEvents:
37943801
- client: *client
37953802
events:
3803+
- commandStartedEvent:
3804+
commandName: createIndexes
3805+
databaseName: *databaseName
3806+
37963807
- commandStartedEvent:
37973808
commandName: dropIndexes
37983809
databaseName: *databaseName
@@ -3828,19 +3839,26 @@ tests:
38283839
- session:
38293840
id: &session session
38303841
client: *client
3842+
# Create the index first so dropIndex doesn't return IndexNotFound on
3843+
# servers prior to 8.3.
3844+
- name: createIndex
3845+
object: *collection
3846+
arguments:
3847+
keys: { x: 1 }
3848+
name: "x_1"
38313849
- name: dropIndex
38323850
object: *collection
38333851
arguments:
38343852
timeoutMS: &timeoutMS 1000
38353853
maxTimeMS: 5000
38363854
name: "x_1"
3837-
3838-
expectError:
3839-
isClientError: false
3840-
isTimeoutError: false
38413855
expectEvents:
38423856
- client: *client
38433857
events:
3858+
- commandStartedEvent:
3859+
commandName: createIndexes
3860+
databaseName: *databaseName
3861+
38443862
- commandStartedEvent:
38453863
commandName: dropIndexes
38463864
databaseName: *databaseName
@@ -3884,6 +3902,14 @@ tests:
38843902
failCommands: ["dropIndexes"]
38853903
blockConnection: true
38863904
blockTimeMS: 5
3905+
# Create the index first so dropIndex doesn't return IndexNotFound on
3906+
# servers prior to 8.3.
3907+
- name: createIndex
3908+
object: *collection
3909+
arguments:
3910+
keys: { x: 1 }
3911+
name: "x_1"
3912+
timeoutMS: 100000
38873913
- name: dropIndexes
38883914
object: *collection
38893915
arguments:
@@ -3979,4 +4005,4 @@ tests:
39794005
command:
39804006
dropIndexes: *collectionName
39814007
maxTimeMS: { $$lte: *timeoutMS }
3982-
4008+

test/spec/client-side-operations-timeout/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/spec/client-side-operations-timeout/global-timeoutMS.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3120,17 +3120,24 @@ tests:
31203120
failCommands: ["dropIndexes"]
31213121
blockConnection: true
31223122
blockTimeMS: 15
3123+
# Create the index first so dropIndex doesn't return IndexNotFound on
3124+
# servers prior to 8.3.
3125+
- name: createIndex
3126+
object: *collection
3127+
arguments:
3128+
keys: { x: 1 }
3129+
name: "x_1"
31233130
- name: dropIndex
31243131
object: *collection
31253132
arguments:
31263133
name: "x_1"
3127-
3128-
expectError:
3129-
isClientError: false
3130-
isTimeoutError: false
31313134
expectEvents:
31323135
- client: *client
31333136
events:
3137+
- commandStartedEvent:
3138+
commandName: createIndexes
3139+
databaseName: *databaseName
3140+
31343141
- commandStartedEvent:
31353142
commandName: dropIndexes
31363143
databaseName: *databaseName
@@ -3233,4 +3240,4 @@ tests:
32333240
command:
32343241
dropIndexes: *collectionName
32353242
maxTimeMS: { $$exists: false }
3236-
3243+

test/spec/client-side-operations-timeout/override-collection-timeoutMS.json

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3251,22 +3251,34 @@
32513251
}
32523252
}
32533253
},
3254+
{
3255+
"name": "createIndex",
3256+
"object": "collection",
3257+
"arguments": {
3258+
"keys": {
3259+
"x": 1
3260+
},
3261+
"name": "x_1"
3262+
}
3263+
},
32543264
{
32553265
"name": "dropIndex",
32563266
"object": "collection",
32573267
"arguments": {
32583268
"name": "x_1"
3259-
},
3260-
"expectError": {
3261-
"isClientError": false,
3262-
"isTimeoutError": false
32633269
}
32643270
}
32653271
],
32663272
"expectEvents": [
32673273
{
32683274
"client": "client",
32693275
"events": [
3276+
{
3277+
"commandStartedEvent": {
3278+
"commandName": "createIndexes",
3279+
"databaseName": "test"
3280+
}
3281+
},
32703282
{
32713283
"commandStartedEvent": {
32723284
"commandName": "dropIndexes",
@@ -3327,22 +3339,34 @@
33273339
}
33283340
}
33293341
},
3342+
{
3343+
"name": "createIndex",
3344+
"object": "collection",
3345+
"arguments": {
3346+
"keys": {
3347+
"x": 1
3348+
},
3349+
"name": "x_1"
3350+
}
3351+
},
33303352
{
33313353
"name": "dropIndex",
33323354
"object": "collection",
33333355
"arguments": {
33343356
"name": "x_1"
3335-
},
3336-
"expectError": {
3337-
"isClientError": false,
3338-
"isTimeoutError": false
33393357
}
33403358
}
33413359
],
33423360
"expectEvents": [
33433361
{
33443362
"client": "client",
33453363
"events": [
3364+
{
3365+
"commandStartedEvent": {
3366+
"commandName": "createIndexes",
3367+
"databaseName": "test"
3368+
}
3369+
},
33463370
{
33473371
"commandStartedEvent": {
33483372
"commandName": "dropIndexes",

0 commit comments

Comments
 (0)