Skip to content

Commit 35b385f

Browse files
committed
CSHARP-4176: Sync'd change-streams unified spec tests.
1 parent 19abca4 commit 35b385f

File tree

2 files changed

+30
-70
lines changed

2 files changed

+30
-70
lines changed

tests/MongoDB.Driver.Tests/Specifications/change-streams/tests/unified/change-streams.json

Lines changed: 22 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
{
66
"minServerVersion": "3.6",
77
"topologies": [
8-
"replicaset",
9-
"sharded-replicaset"
8+
"replicaset"
109
],
1110
"serverless": "forbid"
1211
}
@@ -314,10 +313,7 @@
314313
"description": "Test that comment is set on getMore",
315314
"runOnRequirements": [
316315
{
317-
"minServerVersion": "4.4.0",
318-
"topologies": [
319-
"replicaset"
320-
]
316+
"minServerVersion": "4.4.0"
321317
}
322318
],
323319
"operations": [
@@ -405,10 +401,7 @@
405401
"description": "Test that comment is not set on getMore - pre 4.4",
406402
"runOnRequirements": [
407403
{
408-
"maxServerVersion": "4.3.99",
409-
"topologies": [
410-
"replicaset"
411-
]
404+
"maxServerVersion": "4.3.99"
412405
}
413406
],
414407
"operations": [
@@ -621,6 +614,15 @@
621614
},
622615
{
623616
"description": "Test new structure in ns document MUST NOT err",
617+
"runOnRequirements": [
618+
{
619+
"minServerVersion": "3.6",
620+
"maxServerVersion": "5.2.99"
621+
},
622+
{
623+
"minServerVersion": "6.0"
624+
}
625+
],
624626
"operations": [
625627
{
626628
"name": "createChangeStream",
@@ -797,10 +799,7 @@
797799
"description": "$changeStream must be the first stage in a change stream pipeline sent to the server",
798800
"runOnRequirements": [
799801
{
800-
"minServerVersion": "3.6.0",
801-
"topologies": [
802-
"replicaset"
803-
]
802+
"minServerVersion": "3.6.0"
804803
}
805804
],
806805
"operations": [
@@ -873,10 +872,7 @@
873872
"description": "The server returns change stream responses in the specified server response format",
874873
"runOnRequirements": [
875874
{
876-
"minServerVersion": "3.6.0",
877-
"topologies": [
878-
"replicaset"
879-
]
875+
"minServerVersion": "3.6.0"
880876
}
881877
],
882878
"operations": [
@@ -926,10 +922,7 @@
926922
"description": "Executing a watch helper on a Collection results in notifications for changes to the specified collection",
927923
"runOnRequirements": [
928924
{
929-
"minServerVersion": "3.6.0",
930-
"topologies": [
931-
"replicaset"
932-
]
925+
"minServerVersion": "3.6.0"
933926
}
934927
],
935928
"operations": [
@@ -1014,10 +1007,7 @@
10141007
"description": "Change Stream should allow valid aggregate pipeline stages",
10151008
"runOnRequirements": [
10161009
{
1017-
"minServerVersion": "3.6.0",
1018-
"topologies": [
1019-
"replicaset"
1020-
]
1010+
"minServerVersion": "3.6.0"
10211011
}
10221012
],
10231013
"operations": [
@@ -1104,10 +1094,7 @@
11041094
"description": "Executing a watch helper on a Database results in notifications for changes to all collections in the specified database.",
11051095
"runOnRequirements": [
11061096
{
1107-
"minServerVersion": "3.8.0",
1108-
"topologies": [
1109-
"replicaset"
1110-
]
1097+
"minServerVersion": "3.8.0"
11111098
}
11121099
],
11131100
"operations": [
@@ -1209,10 +1196,7 @@
12091196
"description": "Executing a watch helper on a MongoClient results in notifications for changes to all collections in all databases in the cluster.",
12101197
"runOnRequirements": [
12111198
{
1212-
"minServerVersion": "3.8.0",
1213-
"topologies": [
1214-
"replicaset"
1215-
]
1199+
"minServerVersion": "3.8.0"
12161200
}
12171201
],
12181202
"operations": [
@@ -1333,10 +1317,7 @@
13331317
"description": "Test insert, update, replace, and delete event types",
13341318
"runOnRequirements": [
13351319
{
1336-
"minServerVersion": "3.6.0",
1337-
"topologies": [
1338-
"replicaset"
1339-
]
1320+
"minServerVersion": "3.6.0"
13401321
}
13411322
],
13421323
"operations": [
@@ -1488,10 +1469,7 @@
14881469
"description": "Test rename and invalidate event types",
14891470
"runOnRequirements": [
14901471
{
1491-
"minServerVersion": "4.0.1",
1492-
"topologies": [
1493-
"replicaset"
1494-
]
1472+
"minServerVersion": "4.0.1"
14951473
}
14961474
],
14971475
"operations": [
@@ -1568,10 +1546,7 @@
15681546
"description": "Test drop and invalidate event types",
15691547
"runOnRequirements": [
15701548
{
1571-
"minServerVersion": "4.0.1",
1572-
"topologies": [
1573-
"replicaset"
1574-
]
1549+
"minServerVersion": "4.0.1"
15751550
}
15761551
],
15771552
"operations": [
@@ -1637,10 +1612,7 @@
16371612
"description": "Test consecutive resume",
16381613
"runOnRequirements": [
16391614
{
1640-
"minServerVersion": "4.1.7",
1641-
"topologies": [
1642-
"replicaset"
1643-
]
1615+
"minServerVersion": "4.1.7"
16441616
}
16451617
],
16461618
"operations": [

tests/MongoDB.Driver.Tests/Specifications/change-streams/tests/unified/change-streams.yml

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ schemaVersion: "1.7"
44

55
runOnRequirements:
66
- minServerVersion: "3.6"
7-
topologies: [ replicaset, sharded-replicaset ]
7+
# TODO(DRIVERS-2323): Run all possible tests against sharded clusters once we know the
8+
# cause of unexpected command monitoring events.
9+
topologies: [ replicaset ]
810
serverless: forbid
911

1012
createEntities:
@@ -179,10 +181,6 @@ tests:
179181
- description: "Test that comment is set on getMore"
180182
runOnRequirements:
181183
- minServerVersion: "4.4.0"
182-
# Topologies are limited because of potentially empty getMore responses
183-
# on sharded clusters.
184-
# See https://jira.mongodb.org/browse/DRIVERS-2248 for more details.
185-
topologies: [ replicaset ]
186184
operations:
187185
- name: createChangeStream
188186
object: *collection0
@@ -224,10 +222,6 @@ tests:
224222
- description: "Test that comment is not set on getMore - pre 4.4"
225223
runOnRequirements:
226224
- maxServerVersion: "4.3.99"
227-
# Topologies are limited because of potentially empty getMore responses
228-
# on sharded clusters.
229-
# See https://jira.mongodb.org/browse/DRIVERS-2248 for more details.
230-
topologies: [ replicaset ]
231225
operations:
232226
- name: createChangeStream
233227
object: *collection0
@@ -334,6 +328,10 @@ tests:
334328
newField: "newFieldValue"
335329

336330
- description: "Test new structure in ns document MUST NOT err"
331+
runOnRequirements:
332+
- minServerVersion: "3.6"
333+
maxServerVersion: "5.2.99"
334+
- minServerVersion: "6.0"
337335
operations:
338336
- name: createChangeStream
339337
object: *collection0
@@ -417,7 +415,6 @@ tests:
417415
- description: $changeStream must be the first stage in a change stream pipeline sent to the server
418416
runOnRequirements:
419417
- minServerVersion: "3.6.0"
420-
topologies: [ replicaset ]
421418
operations:
422419
- name: createChangeStream
423420
object: *collection0
@@ -454,7 +451,6 @@ tests:
454451
- description: The server returns change stream responses in the specified server response format
455452
runOnRequirements:
456453
- minServerVersion: "3.6.0"
457-
topologies: [ replicaset ]
458454
operations:
459455
- name: createChangeStream
460456
object: *collection0
@@ -480,7 +476,6 @@ tests:
480476
- description: Executing a watch helper on a Collection results in notifications for changes to the specified collection
481477
runOnRequirements:
482478
- minServerVersion: "3.6.0"
483-
topologies: [ replicaset ]
484479
operations:
485480
- name: createChangeStream
486481
object: *collection0
@@ -523,7 +518,6 @@ tests:
523518
- description: Change Stream should allow valid aggregate pipeline stages
524519
runOnRequirements:
525520
- minServerVersion: "3.6.0"
526-
topologies: [ replicaset ]
527521
operations:
528522
- name: createChangeStream
529523
object: *collection0
@@ -568,7 +562,6 @@ tests:
568562
- description: Executing a watch helper on a Database results in notifications for changes to all collections in the specified database.
569563
runOnRequirements:
570564
- minServerVersion: "3.8.0"
571-
topologies: [ replicaset ]
572565
operations:
573566
- name: createChangeStream
574567
object: *database0
@@ -621,7 +614,6 @@ tests:
621614
- description: Executing a watch helper on a MongoClient results in notifications for changes to all collections in all databases in the cluster.
622615
runOnRequirements:
623616
- minServerVersion: "3.8.0"
624-
topologies: [ replicaset ]
625617
operations:
626618
- name: createChangeStream
627619
object: *client0
@@ -685,7 +677,6 @@ tests:
685677
- description: "Test insert, update, replace, and delete event types"
686678
runOnRequirements:
687679
- minServerVersion: "3.6.0"
688-
topologies: [ replicaset ]
689680
operations:
690681
- name: createChangeStream
691682
object: *collection0
@@ -763,7 +754,6 @@ tests:
763754
- description: Test rename and invalidate event types
764755
runOnRequirements:
765756
- minServerVersion: "4.0.1"
766-
topologies: [ replicaset ]
767757
operations:
768758
- name: createChangeStream
769759
object: *collection0
@@ -806,7 +796,6 @@ tests:
806796
- description: Test drop and invalidate event types
807797
runOnRequirements:
808798
- minServerVersion: "4.0.1"
809-
topologies: [ replicaset ]
810799
operations:
811800
- name: createChangeStream
812801
object: *collection0
@@ -840,11 +829,10 @@ tests:
840829
databaseName: *database0
841830

842831
# Test that resume logic works correctly even after consecutive retryable failures of a getMore command,
843-
# with no intervening events. This is ensured by setting the batch size of the change stream to 1,
832+
# with no intervening events. This is ensured by setting the batch size of the change stream to 1,
844833
- description: Test consecutive resume
845834
runOnRequirements:
846835
- minServerVersion: "4.1.7"
847-
topologies: [ replicaset ]
848836
operations:
849837
- name: failPoint
850838
object: testRunner

0 commit comments

Comments
 (0)