Skip to content

Commit

Permalink
restrict change stream tests to replica sets
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed May 23, 2022
1 parent 03886b1 commit 6546428
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 70 deletions.
63 changes: 13 additions & 50 deletions test/spec/change-streams/unified/change-streams.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
{
"minServerVersion": "3.6",
"topologies": [
"replicaset",
"sharded-replicaset"
"replicaset"
]
}
],
Expand Down Expand Up @@ -313,10 +312,7 @@
"description": "Test that comment is set on getMore",
"runOnRequirements": [
{
"minServerVersion": "4.4.0",
"topologies": [
"replicaset"
]
"minServerVersion": "4.4.0"
}
],
"operations": [
Expand Down Expand Up @@ -404,10 +400,7 @@
"description": "Test that comment is not set on getMore - pre 4.4",
"runOnRequirements": [
{
"maxServerVersion": "4.3.99",
"topologies": [
"replicaset"
]
"maxServerVersion": "4.3.99"
}
],
"operations": [
Expand Down Expand Up @@ -796,10 +789,7 @@
"description": "$changeStream must be the first stage in a change stream pipeline sent to the server",
"runOnRequirements": [
{
"minServerVersion": "3.6.0",
"topologies": [
"replicaset"
]
"minServerVersion": "3.6.0"
}
],
"operations": [
Expand Down Expand Up @@ -872,10 +862,7 @@
"description": "The server returns change stream responses in the specified server response format",
"runOnRequirements": [
{
"minServerVersion": "3.6.0",
"topologies": [
"replicaset"
]
"minServerVersion": "3.6.0"
}
],
"operations": [
Expand Down Expand Up @@ -925,10 +912,7 @@
"description": "Executing a watch helper on a Collection results in notifications for changes to the specified collection",
"runOnRequirements": [
{
"minServerVersion": "3.6.0",
"topologies": [
"replicaset"
]
"minServerVersion": "3.6.0"
}
],
"operations": [
Expand Down Expand Up @@ -1013,10 +997,7 @@
"description": "Change Stream should allow valid aggregate pipeline stages",
"runOnRequirements": [
{
"minServerVersion": "3.6.0",
"topologies": [
"replicaset"
]
"minServerVersion": "3.6.0"
}
],
"operations": [
Expand Down Expand Up @@ -1103,10 +1084,7 @@
"description": "Executing a watch helper on a Database results in notifications for changes to all collections in the specified database.",
"runOnRequirements": [
{
"minServerVersion": "3.8.0",
"topologies": [
"replicaset"
]
"minServerVersion": "3.8.0"
}
],
"operations": [
Expand Down Expand Up @@ -1208,10 +1186,7 @@
"description": "Executing a watch helper on a MongoClient results in notifications for changes to all collections in all databases in the cluster.",
"runOnRequirements": [
{
"minServerVersion": "3.8.0",
"topologies": [
"replicaset"
]
"minServerVersion": "3.8.0"
}
],
"operations": [
Expand Down Expand Up @@ -1332,10 +1307,7 @@
"description": "Test insert, update, replace, and delete event types",
"runOnRequirements": [
{
"minServerVersion": "3.6.0",
"topologies": [
"replicaset"
]
"minServerVersion": "3.6.0"
}
],
"operations": [
Expand Down Expand Up @@ -1487,10 +1459,7 @@
"description": "Test rename and invalidate event types",
"runOnRequirements": [
{
"minServerVersion": "4.0.1",
"topologies": [
"replicaset"
]
"minServerVersion": "4.0.1"
}
],
"operations": [
Expand Down Expand Up @@ -1567,10 +1536,7 @@
"description": "Test drop and invalidate event types",
"runOnRequirements": [
{
"minServerVersion": "4.0.1",
"topologies": [
"replicaset"
]
"minServerVersion": "4.0.1"
}
],
"operations": [
Expand Down Expand Up @@ -1636,10 +1602,7 @@
"description": "Test consecutive resume",
"runOnRequirements": [
{
"minServerVersion": "4.1.7",
"topologies": [
"replicaset"
]
"minServerVersion": "4.1.7"
}
],
"operations": [
Expand Down
31 changes: 11 additions & 20 deletions test/spec/change-streams/unified/change-streams.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
description: "change-streams"

schemaVersion: "1.7"

runOnRequirements:
- minServerVersion: "3.6"
topologies: [ replicaset, sharded-replicaset ]
# TODO(DRIVERS-2323): Run all possible tests against sharded clusters once we know the
# cause of unexpected command monitoring events.
topologies: [ replicaset ]

createEntities:
- client:
id: &client0 client0
Expand Down Expand Up @@ -175,10 +180,6 @@ tests:
- description: "Test that comment is set on getMore"
runOnRequirements:
- minServerVersion: "4.4.0"
# Topologies are limited because of potentially empty getMore responses
# on sharded clusters.
# See https://jira.mongodb.org/browse/DRIVERS-2248 for more details.
topologies: [ replicaset ]
operations:
- name: createChangeStream
object: *collection0
Expand Down Expand Up @@ -220,10 +221,6 @@ tests:
- description: "Test that comment is not set on getMore - pre 4.4"
runOnRequirements:
- maxServerVersion: "4.3.99"
# Topologies are limited because of potentially empty getMore responses
# on sharded clusters.
# See https://jira.mongodb.org/browse/DRIVERS-2248 for more details.
topologies: [ replicaset ]
operations:
- name: createChangeStream
object: *collection0
Expand Down Expand Up @@ -330,6 +327,10 @@ tests:
newField: "newFieldValue"

- description: "Test new structure in ns document MUST NOT err"
runOnRequirements:
- minServerVersion: "3.6"
maxServerVersion: "5.2.99"
- minServerVersion: "6.0"
operations:
- name: createChangeStream
object: *collection0
Expand Down Expand Up @@ -413,7 +414,6 @@ tests:
- description: $changeStream must be the first stage in a change stream pipeline sent to the server
runOnRequirements:
- minServerVersion: "3.6.0"
topologies: [ replicaset ]
operations:
- name: createChangeStream
object: *collection0
Expand Down Expand Up @@ -450,7 +450,6 @@ tests:
- description: The server returns change stream responses in the specified server response format
runOnRequirements:
- minServerVersion: "3.6.0"
topologies: [ replicaset ]
operations:
- name: createChangeStream
object: *collection0
Expand All @@ -476,7 +475,6 @@ tests:
- description: Executing a watch helper on a Collection results in notifications for changes to the specified collection
runOnRequirements:
- minServerVersion: "3.6.0"
topologies: [ replicaset ]
operations:
- name: createChangeStream
object: *collection0
Expand Down Expand Up @@ -519,7 +517,6 @@ tests:
- description: Change Stream should allow valid aggregate pipeline stages
runOnRequirements:
- minServerVersion: "3.6.0"
topologies: [ replicaset ]
operations:
- name: createChangeStream
object: *collection0
Expand Down Expand Up @@ -564,7 +561,6 @@ tests:
- description: Executing a watch helper on a Database results in notifications for changes to all collections in the specified database.
runOnRequirements:
- minServerVersion: "3.8.0"
topologies: [ replicaset ]
operations:
- name: createChangeStream
object: *database0
Expand Down Expand Up @@ -617,7 +613,6 @@ tests:
- description: Executing a watch helper on a MongoClient results in notifications for changes to all collections in all databases in the cluster.
runOnRequirements:
- minServerVersion: "3.8.0"
topologies: [ replicaset ]
operations:
- name: createChangeStream
object: *client0
Expand Down Expand Up @@ -681,7 +676,6 @@ tests:
- description: "Test insert, update, replace, and delete event types"
runOnRequirements:
- minServerVersion: "3.6.0"
topologies: [ replicaset ]
operations:
- name: createChangeStream
object: *collection0
Expand Down Expand Up @@ -759,7 +753,6 @@ tests:
- description: Test rename and invalidate event types
runOnRequirements:
- minServerVersion: "4.0.1"
topologies: [ replicaset ]
operations:
- name: createChangeStream
object: *collection0
Expand Down Expand Up @@ -802,7 +795,6 @@ tests:
- description: Test drop and invalidate event types
runOnRequirements:
- minServerVersion: "4.0.1"
topologies: [ replicaset ]
operations:
- name: createChangeStream
object: *collection0
Expand Down Expand Up @@ -836,11 +828,10 @@ tests:
databaseName: *database0

# Test that resume logic works correctly even after consecutive retryable failures of a getMore command,
# with no intervening events. This is ensured by setting the batch size of the change stream to 1,
# with no intervening events. This is ensured by setting the batch size of the change stream to 1,
- description: Test consecutive resume
runOnRequirements:
- minServerVersion: "4.1.7"
topologies: [ replicaset ]
operations:
- name: failPoint
object: testRunner
Expand Down

0 comments on commit 6546428

Please sign in to comment.