Skip to content

Commit af02eb8

Browse files
committed
sync spec tests
1 parent 1f27040 commit af02eb8

26 files changed

+1249
-141
lines changed

test/spec/client-side-operations-timeout/README.md

Lines changed: 661 additions & 0 deletions
Large diffs are not rendered by default.

test/spec/client-side-operations-timeout/change-streams.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"aggregate"
105105
],
106106
"blockConnection": true,
107-
"blockTimeMS": 55
107+
"blockTimeMS": 250
108108
}
109109
}
110110
}
@@ -114,7 +114,7 @@
114114
"object": "collection",
115115
"arguments": {
116116
"pipeline": [],
117-
"timeoutMS": 50
117+
"timeoutMS": 200
118118
},
119119
"expectError": {
120120
"isTimeoutError": true
@@ -242,7 +242,7 @@
242242
"getMore"
243243
],
244244
"blockConnection": true,
245-
"blockTimeMS": 15
245+
"blockTimeMS": 150
246246
}
247247
}
248248
}
@@ -252,7 +252,7 @@
252252
"object": "collection",
253253
"arguments": {
254254
"pipeline": [],
255-
"timeoutMS": 20,
255+
"timeoutMS": 200,
256256
"batchSize": 2,
257257
"maxAwaitTimeMS": 1
258258
},
@@ -310,7 +310,7 @@
310310
"object": "collection",
311311
"arguments": {
312312
"pipeline": [],
313-
"timeoutMS": 20
313+
"timeoutMS": 200
314314
},
315315
"saveResultAsEntity": "changeStream"
316316
},
@@ -330,7 +330,7 @@
330330
"aggregate"
331331
],
332332
"blockConnection": true,
333-
"blockTimeMS": 12,
333+
"blockTimeMS": 120,
334334
"errorCode": 7,
335335
"errorLabels": [
336336
"ResumableChangeStreamError"
@@ -412,7 +412,7 @@
412412
"arguments": {
413413
"pipeline": [],
414414
"maxAwaitTimeMS": 1,
415-
"timeoutMS": 100
415+
"timeoutMS": 200
416416
},
417417
"saveResultAsEntity": "changeStream"
418418
},
@@ -431,7 +431,7 @@
431431
"getMore"
432432
],
433433
"blockConnection": true,
434-
"blockTimeMS": 150
434+
"blockTimeMS": 250
435435
}
436436
}
437437
}
@@ -534,7 +534,7 @@
534534
"getMore"
535535
],
536536
"blockConnection": true,
537-
"blockTimeMS": 15
537+
"blockTimeMS": 250
538538
}
539539
}
540540
}
@@ -544,7 +544,7 @@
544544
"object": "collection",
545545
"arguments": {
546546
"pipeline": [],
547-
"timeoutMS": 10
547+
"timeoutMS": 200
548548
},
549549
"saveResultAsEntity": "changeStream"
550550
},

test/spec/client-side-operations-timeout/change-streams.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ tests:
6767
data:
6868
failCommands: ["aggregate"]
6969
blockConnection: true
70-
blockTimeMS: 55
70+
blockTimeMS: 250
7171
- name: createChangeStream
7272
object: *collection
7373
arguments:
7474
pipeline: []
75-
timeoutMS: 50
75+
timeoutMS: 200
7676
expectError:
7777
isTimeoutError: true
7878
expectEvents:
@@ -142,12 +142,12 @@ tests:
142142
data:
143143
failCommands: ["aggregate", "getMore"]
144144
blockConnection: true
145-
blockTimeMS: 15
145+
blockTimeMS: 150
146146
- name: createChangeStream
147147
object: *collection
148148
arguments:
149149
pipeline: []
150-
timeoutMS: 20
150+
timeoutMS: 200
151151
batchSize: 2
152152
maxAwaitTimeMS: 1
153153
saveResultAsEntity: &changeStream changeStream
@@ -171,16 +171,16 @@ tests:
171171
maxTimeMS: 1
172172

173173
# The timeout should be applied to the entire resume attempt, not individually to each command. The test creates a
174-
# change stream with timeoutMS=20 which returns an empty initial batch and then sets a fail point to block both
175-
# getMore and aggregate for 12ms each and fail with a resumable error. When the resume attempt happens, the getMore
176-
# and aggregate block for longer than 20ms total, so it times out.
174+
# change stream with timeoutMS=200 which returns an empty initial batch and then sets a fail point to block both
175+
# getMore and aggregate for 120ms each and fail with a resumable error. When the resume attempt happens, the getMore
176+
# and aggregate block for longer than 200ms total, so it times out.
177177
- description: "timeoutMS applies to full resume attempt in a next call"
178178
operations:
179179
- name: createChangeStream
180180
object: *collection
181181
arguments:
182182
pipeline: []
183-
timeoutMS: 20
183+
timeoutMS: 200
184184
saveResultAsEntity: &changeStream changeStream
185185
- name: failPoint
186186
object: testRunner
@@ -192,7 +192,7 @@ tests:
192192
data:
193193
failCommands: ["getMore", "aggregate"]
194194
blockConnection: true
195-
blockTimeMS: 12
195+
blockTimeMS: 120
196196
errorCode: 7 # HostNotFound - resumable but does not require an SDAM state change.
197197
# failCommand doesn't correctly add the ResumableChangeStreamError by default. It needs to be specified
198198
# manually here so the error is considered resumable. The failGetMoreAfterCursorCheckout fail point
@@ -234,9 +234,9 @@ tests:
234234
# Specify a short maxAwaitTimeMS because otherwise the getMore on the new cursor will wait for 1000ms and
235235
# time out.
236236
maxAwaitTimeMS: 1
237-
timeoutMS: 100
237+
timeoutMS: 200
238238
saveResultAsEntity: &changeStream changeStream
239-
# Block getMore for 150ms to force the next() call to time out.
239+
# Block getMore for 250ms to force the next() call to time out.
240240
- name: failPoint
241241
object: testRunner
242242
arguments:
@@ -247,7 +247,7 @@ tests:
247247
data:
248248
failCommands: ["getMore"]
249249
blockConnection: true
250-
blockTimeMS: 150
250+
blockTimeMS: 250
251251
# The original aggregate didn't return any events so this should do a getMore and return a timeout error.
252252
- name: iterateUntilDocumentOrError
253253
object: *changeStream
@@ -290,7 +290,7 @@ tests:
290290
collection: *collectionName
291291

292292
# The timeoutMS value should be refreshed for getMore's. This is a failure test. The createChangeStream operation
293-
# sets timeoutMS=10 and the getMore blocks for 15ms, causing iteration to fail with a timeout error.
293+
# sets timeoutMS=200 and the getMore blocks for 250ms, causing iteration to fail with a timeout error.
294294
- description: "timeoutMS is refreshed for getMore - failure"
295295
operations:
296296
- name: failPoint
@@ -303,12 +303,12 @@ tests:
303303
data:
304304
failCommands: ["getMore"]
305305
blockConnection: true
306-
blockTimeMS: 15
306+
blockTimeMS: 250
307307
- name: createChangeStream
308308
object: *collection
309309
arguments:
310310
pipeline: []
311-
timeoutMS: 10
311+
timeoutMS: 200
312312
saveResultAsEntity: &changeStream changeStream
313313
# The first iteration should do a getMore
314314
- name: iterateUntilDocumentOrError

test/spec/client-side-operations-timeout/close-cursors.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"getMore"
7676
],
7777
"blockConnection": true,
78-
"blockTimeMS": 50
78+
"blockTimeMS": 250
7979
}
8080
}
8181
}
@@ -86,7 +86,7 @@
8686
"arguments": {
8787
"filter": {},
8888
"batchSize": 2,
89-
"timeoutMS": 20
89+
"timeoutMS": 200
9090
},
9191
"saveResultAsEntity": "cursor"
9292
},
@@ -175,7 +175,7 @@
175175
"killCursors"
176176
],
177177
"blockConnection": true,
178-
"blockTimeMS": 30
178+
"blockTimeMS": 250
179179
}
180180
}
181181
}
@@ -186,15 +186,15 @@
186186
"arguments": {
187187
"filter": {},
188188
"batchSize": 2,
189-
"timeoutMS": 20
189+
"timeoutMS": 200
190190
},
191191
"saveResultAsEntity": "cursor"
192192
},
193193
{
194194
"name": "close",
195195
"object": "cursor",
196196
"arguments": {
197-
"timeoutMS": 40
197+
"timeoutMS": 400
198198
}
199199
}
200200
],
@@ -215,7 +215,7 @@
215215
{
216216
"commandStartedEvent": {
217217
"command": {
218-
"killCursors": "collection",
218+
"killCursors": "coll",
219219
"maxTimeMS": {
220220
"$$type": [
221221
"int",

test/spec/client-side-operations-timeout/close-cursors.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ tests:
4646
data:
4747
failCommands: ["getMore"]
4848
blockConnection: true
49-
blockTimeMS: 50
49+
blockTimeMS: 250
5050
- name: createFindCursor
5151
object: *collection
5252
arguments:
5353
filter: {}
5454
batchSize: 2
55-
timeoutMS: 20
55+
timeoutMS: 200
5656
saveResultAsEntity: &cursor cursor
5757
# Iterate the cursor three times. The third should do a getMore, which should fail with a timeout error.
5858
- name: iterateUntilDocumentOrError
@@ -99,18 +99,18 @@ tests:
9999
data:
100100
failCommands: ["killCursors"]
101101
blockConnection: true
102-
blockTimeMS: 30
102+
blockTimeMS: 250
103103
- name: createFindCursor
104104
object: *collection
105105
arguments:
106106
filter: {}
107107
batchSize: 2
108-
timeoutMS: 20
108+
timeoutMS: 200
109109
saveResultAsEntity: &cursor cursor
110110
- name: close
111111
object: *cursor
112112
arguments:
113-
timeoutMS: 40
113+
timeoutMS: 400
114114
expectEvents:
115115
- client: *client
116116
events:
@@ -120,7 +120,7 @@ tests:
120120
commandName: find
121121
- commandStartedEvent:
122122
command:
123-
killCursors: *collection
123+
killCursors: *collectionName
124124
maxTimeMS: { $$type: ["int", "long"] }
125125
commandName: killCursors
126126
- commandSucceededEvent:

test/spec/client-side-operations-timeout/command-execution.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"schemaVersion": "1.9",
44
"runOnRequirements": [
55
{
6-
"minServerVersion": "4.9",
6+
"minServerVersion": "4.4.7",
77
"topologies": [
88
"single",
99
"replicaset",

test/spec/client-side-operations-timeout/command-execution.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ description: "timeoutMS behaves correctly during command execution"
33
schemaVersion: "1.9"
44

55
runOnRequirements:
6-
# The appName filter cannot be used to set a fail point on connection handshakes until server version 4.9 due to
7-
# SERVER-49220/SERVER-49336.
8-
- minServerVersion: "4.9"
6+
# Require SERVER-49336 for failCommand + appName on the initial handshake.
7+
- minServerVersion: "4.4.7"
98
# Skip load-balanced and serverless which do not support RTT measurements.
109
topologies: [ single, replicaset, sharded ]
1110
serverless: forbid

test/spec/client-side-operations-timeout/convenient-transactions.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"client": {
2222
"id": "client",
2323
"uriOptions": {
24-
"timeoutMS": 50
24+
"timeoutMS": 500
2525
},
2626
"useMultipleMongoses": false,
2727
"observeEvents": [
@@ -81,6 +81,9 @@
8181
}
8282
}
8383
]
84+
},
85+
"expectError": {
86+
"isClientError": true
8487
}
8588
}
8689
],
@@ -109,7 +112,7 @@
109112
"insert"
110113
],
111114
"blockConnection": true,
112-
"blockTimeMS": 30
115+
"blockTimeMS": 300
113116
}
114117
}
115118
}
@@ -182,6 +185,21 @@
182185
}
183186
}
184187
}
188+
},
189+
{
190+
"commandStartedEvent": {
191+
"commandName": "abortTransaction",
192+
"databaseName": "admin",
193+
"command": {
194+
"abortTransaction": 1,
195+
"maxTimeMS": {
196+
"$$type": [
197+
"int",
198+
"long"
199+
]
200+
}
201+
}
202+
}
185203
}
186204
]
187205
}

0 commit comments

Comments
 (0)