@@ -234,7 +234,11 @@ func TestCSOT(t *testing.T) {
234
234
sendsMaxTimeMSWithTimeoutMS : true ,
235
235
sendsMaxTimeMSWithContextDeadline : true ,
236
236
preventsConnClosureWithTimeoutMS : true ,
237
- topologies : []mtest.TopologyKind {mtest .ReplicaSet },
237
+ // Change Streams aren't supported on standalone topologies.
238
+ topologies : []mtest.TopologyKind {
239
+ mtest .ReplicaSet ,
240
+ mtest .Sharded ,
241
+ },
238
242
},
239
243
{
240
244
desc : "Cursor getMore" ,
@@ -436,6 +440,21 @@ func TestCSOT(t *testing.T) {
436
440
}
437
441
})
438
442
}
443
+
444
+ csotOpts := mtest .NewOptions ().ClientOptions (options .Client ().SetTimeout (10 * time .Second ))
445
+ mt .RunOpts ("maxTimeMS is omitted for values greater than 2147483647ms]" , csotOpts , func (mt * mtest.T ) {
446
+ ctx , cancel := context .WithTimeout (context .Background (), (2147483647 + 1 )* time .Millisecond )
447
+ defer cancel ()
448
+ _ , err := mt .Coll .InsertOne (ctx , bson.D {})
449
+ require .NoError (t , err )
450
+
451
+ evt := mt .GetStartedEvent ()
452
+ _ , err = evt .Command .LookupErr ("maxTimeMS" )
453
+ assert .ErrorIs (mt ,
454
+ err ,
455
+ bsoncore .ErrElementNotFound ,
456
+ "expected maxTimeMS BSON value to be missing, but is present" )
457
+ })
439
458
}
440
459
441
460
func TestCSOT_errors (t * testing.T ) {
0 commit comments