1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
description: "change-streams-errors"
schemaVersion: "1.7"
runOnRequirements:
# 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
observeEvents: [ commandStartedEvent ]
ignoreCommandMonitoringEvents: [ killCursors ]
useMultipleMongoses: false
- client:
id: &globalClient globalClient
useMultipleMongoses: false
- database:
id: &database0 database0
client: *client0
databaseName: *database0
- collection:
id: &collection0 collection0
database: *database0
collectionName: *collection0
- database:
id: &globalDatabase0 globalDatabase0
client: *globalClient
databaseName: *database0
- collection:
id: &globalCollection0 globalCollection0
database: *globalDatabase0
collectionName: *collection0
initialData:
- collectionName: *collection0
databaseName: *database0
documents: []
tests:
- description: "The watch helper must not throw a custom exception when executed against a single server topology, but instead depend on a server error"
runOnRequirements:
- minServerVersion: "3.6.0"
topologies: [ single ]
operations:
- name: createChangeStream
object: *collection0
arguments: { pipeline: [] }
expectError: { errorCode: 40573 }
- description: Change Stream should error when an invalid aggregation stage is passed in
runOnRequirements:
- minServerVersion: "3.6.0"
topologies: [ replicaset ]
operations:
- name: createChangeStream
object: *collection0
arguments:
pipeline: [ { $unsupported: foo } ]
expectError: { errorCode: 40324 }
expectEvents:
- client: *client0
ignoreExtraEvents: true
events:
- commandStartedEvent:
command:
aggregate: *collection0
cursor: {}
pipeline:
- $changeStream: {}
- $unsupported: foo
commandName: aggregate
databaseName: *database0
- description: Change Stream should error when _id is projected out
runOnRequirements:
- minServerVersion: "4.1.11"
topologies: [ replicaset, sharded, load-balanced ]
operations:
- name: createChangeStream
object: *collection0
arguments:
pipeline:
- $project: { _id: 0 }
saveResultAsEntity: &changeStream0 changeStream0
- name: insertOne
object: *globalCollection0
arguments:
document: { z: 3 }
- name: iterateUntilDocumentOrError
object: *changeStream0
expectError: { errorCode: 280 }
- description: change stream errors on ElectionInProgress
runOnRequirements:
- minServerVersion: "4.2"
topologies: [ replicaset, sharded, load-balanced ]
operations:
- name: failPoint
object: testRunner
arguments:
client: *globalClient
failPoint:
configureFailPoint: failCommand
mode: { times: 1 }
data:
failCommands: [ getMore ]
errorCode: 216
closeConnection: false
- name: createChangeStream
object: *collection0
arguments:
pipeline: []
saveResultAsEntity: &changeStream0 changeStream0
- name: insertOne
object: *globalCollection0
arguments:
document: { z: 3 }
- name: iterateUntilDocumentOrError
object: *changeStream0
expectError: { errorCode: 216 }
|