File tree Expand file tree Collapse file tree 2 files changed +85
-0
lines changed
testdata/client-side-operations-timeout Expand file tree Collapse file tree 2 files changed +85
-0
lines changed Original file line number Diff line number Diff line change 471
471
]
472
472
}
473
473
]
474
+ },
475
+ {
476
+ "description" : " apply maxAwaitTimeMS if less than remaining timeout" ,
477
+ "operations" : [
478
+ {
479
+ "name" : " createFindCursor" ,
480
+ "object" : " collection" ,
481
+ "arguments" : {
482
+ "filter" : {},
483
+ "cursorType" : " tailableAwait" ,
484
+ "batchSize" : 1 ,
485
+ "maxAwaitTimeMS" : 50
486
+ },
487
+ "saveResultAsEntity" : " tailableCursor"
488
+ },
489
+ {
490
+ "name" : " iterateOnce" ,
491
+ "object" : " tailableCursor" ,
492
+ "arguments" : {
493
+ "timeoutMS" : 100
494
+ }
495
+ },
496
+ {
497
+ "name" : " iterateOnce" ,
498
+ "object" : " tailableCursor" ,
499
+ "arguments" : {
500
+ "timeoutMS" : 100
501
+ }
502
+ }
503
+ ],
504
+ "expectEvents" : [
505
+ {
506
+ "client" : " client" ,
507
+ "events" : [
508
+ {
509
+ "commandStartedEvent" : {
510
+ "commandName" : " find" ,
511
+ "databaseName" : " test"
512
+ }
513
+ },
514
+ {
515
+ "commandStartedEvent" : {
516
+ "commandName" : " getMore" ,
517
+ "databaseName" : " test" ,
518
+ "command" : {
519
+ "maxTimeMS" : {
520
+ "$$lte" : 50
521
+ }
522
+ }
523
+ }
524
+ }
525
+ ]
526
+ }
527
+ ]
474
528
}
475
529
]
476
530
}
Original file line number Diff line number Diff line change @@ -276,3 +276,34 @@ tests:
276
276
databaseName : *databaseName
277
277
command :
278
278
maxTimeMS : { $$lte: 50 }
279
+
280
+ - description : " apply maxAwaitTimeMS if less than remaining timeout"
281
+ operations :
282
+ - name : createFindCursor
283
+ object : *collection
284
+ arguments :
285
+ filter : {}
286
+ cursorType : tailableAwait
287
+ batchSize : 1
288
+ maxAwaitTimeMS : 50
289
+ saveResultAsEntity : &tailableCursor tailableCursor
290
+ # Iterate twice to force a getMore.
291
+ - name : iterateOnce
292
+ object : *tailableCursor
293
+ arguments :
294
+ timeoutMS : 100
295
+ - name : iterateOnce
296
+ object : *tailableCursor
297
+ arguments :
298
+ timeoutMS : 100
299
+ expectEvents :
300
+ - client : *client
301
+ events :
302
+ - commandStartedEvent :
303
+ commandName : find
304
+ databaseName : *databaseName
305
+ - commandStartedEvent :
306
+ commandName : getMore
307
+ databaseName : *databaseName
308
+ command :
309
+ maxTimeMS : { $$lte: 50 }
You can’t perform that action at this time.
0 commit comments