|
| 1 | +{ |
| 2 | + "description": "change-streams-errors", |
| 3 | + "schemaVersion": "1.7", |
| 4 | + "createEntities": [ |
| 5 | + { |
| 6 | + "client": { |
| 7 | + "id": "client0", |
| 8 | + "observeEvents": [ |
| 9 | + "commandStartedEvent" |
| 10 | + ], |
| 11 | + "ignoreCommandMonitoringEvents": [ |
| 12 | + "killCursors" |
| 13 | + ], |
| 14 | + "useMultipleMongoses": false |
| 15 | + } |
| 16 | + }, |
| 17 | + { |
| 18 | + "client": { |
| 19 | + "id": "globalClient", |
| 20 | + "useMultipleMongoses": false |
| 21 | + } |
| 22 | + }, |
| 23 | + { |
| 24 | + "database": { |
| 25 | + "id": "database0", |
| 26 | + "client": "client0", |
| 27 | + "databaseName": "database0" |
| 28 | + } |
| 29 | + }, |
| 30 | + { |
| 31 | + "collection": { |
| 32 | + "id": "collection0", |
| 33 | + "database": "database0", |
| 34 | + "collectionName": "collection0" |
| 35 | + } |
| 36 | + }, |
| 37 | + { |
| 38 | + "database": { |
| 39 | + "id": "globalDatabase0", |
| 40 | + "client": "globalClient", |
| 41 | + "databaseName": "database0" |
| 42 | + } |
| 43 | + }, |
| 44 | + { |
| 45 | + "collection": { |
| 46 | + "id": "globalCollection0", |
| 47 | + "database": "globalDatabase0", |
| 48 | + "collectionName": "collection0" |
| 49 | + } |
| 50 | + } |
| 51 | + ], |
| 52 | + "tests": [ |
| 53 | + { |
| 54 | + "description": "The watch helper must not throw a custom exception when executed against a single server topology, but instead depend on a server error", |
| 55 | + "runOnRequirements": [ |
| 56 | + { |
| 57 | + "minServerVersion": "3.6.0", |
| 58 | + "topologies": [ |
| 59 | + "single" |
| 60 | + ] |
| 61 | + } |
| 62 | + ], |
| 63 | + "operations": [ |
| 64 | + { |
| 65 | + "name": "createChangeStream", |
| 66 | + "object": "collection0", |
| 67 | + "arguments": { |
| 68 | + "pipeline": [] |
| 69 | + }, |
| 70 | + "expectError": { |
| 71 | + "errorCode": 40573 |
| 72 | + } |
| 73 | + } |
| 74 | + ] |
| 75 | + }, |
| 76 | + { |
| 77 | + "description": "Change Stream should error when an invalid aggregation stage is passed in", |
| 78 | + "runOnRequirements": [ |
| 79 | + { |
| 80 | + "minServerVersion": "3.6.0", |
| 81 | + "topologies": [ |
| 82 | + "replicaset" |
| 83 | + ] |
| 84 | + } |
| 85 | + ], |
| 86 | + "operations": [ |
| 87 | + { |
| 88 | + "name": "createChangeStream", |
| 89 | + "object": "collection0", |
| 90 | + "arguments": { |
| 91 | + "pipeline": [ |
| 92 | + { |
| 93 | + "$unsupported": "foo" |
| 94 | + } |
| 95 | + ] |
| 96 | + }, |
| 97 | + "expectError": { |
| 98 | + "errorCode": 40324 |
| 99 | + } |
| 100 | + } |
| 101 | + ], |
| 102 | + "expectEvents": [ |
| 103 | + { |
| 104 | + "client": "client0", |
| 105 | + "ignoreExtraEvents": true, |
| 106 | + "events": [ |
| 107 | + { |
| 108 | + "commandStartedEvent": { |
| 109 | + "command": { |
| 110 | + "aggregate": "collection0", |
| 111 | + "cursor": {}, |
| 112 | + "pipeline": [ |
| 113 | + { |
| 114 | + "$changeStream": {} |
| 115 | + }, |
| 116 | + { |
| 117 | + "$unsupported": "foo" |
| 118 | + } |
| 119 | + ] |
| 120 | + }, |
| 121 | + "commandName": "aggregate", |
| 122 | + "databaseName": "database0" |
| 123 | + } |
| 124 | + } |
| 125 | + ] |
| 126 | + } |
| 127 | + ] |
| 128 | + }, |
| 129 | + { |
| 130 | + "description": "Change Stream should error when _id is projected out", |
| 131 | + "runOnRequirements": [ |
| 132 | + { |
| 133 | + "minServerVersion": "4.1.11", |
| 134 | + "topologies": [ |
| 135 | + "replicaset", |
| 136 | + "sharded-replicaset", |
| 137 | + "load-balanced" |
| 138 | + ] |
| 139 | + } |
| 140 | + ], |
| 141 | + "operations": [ |
| 142 | + { |
| 143 | + "name": "createChangeStream", |
| 144 | + "object": "collection0", |
| 145 | + "arguments": { |
| 146 | + "pipeline": [ |
| 147 | + { |
| 148 | + "$project": { |
| 149 | + "_id": 0 |
| 150 | + } |
| 151 | + } |
| 152 | + ] |
| 153 | + }, |
| 154 | + "saveResultAsEntity": "changeStream0" |
| 155 | + }, |
| 156 | + { |
| 157 | + "name": "insertOne", |
| 158 | + "object": "globalCollection0", |
| 159 | + "arguments": { |
| 160 | + "document": { |
| 161 | + "z": 3 |
| 162 | + } |
| 163 | + } |
| 164 | + }, |
| 165 | + { |
| 166 | + "name": "iterateUntilDocumentOrError", |
| 167 | + "object": "changeStream0", |
| 168 | + "expectError": { |
| 169 | + "errorCode": 280 |
| 170 | + } |
| 171 | + } |
| 172 | + ] |
| 173 | + }, |
| 174 | + { |
| 175 | + "description": "change stream errors on ElectionInProgress", |
| 176 | + "runOnRequirements": [ |
| 177 | + { |
| 178 | + "minServerVersion": "4.2", |
| 179 | + "topologies": [ |
| 180 | + "replicaset", |
| 181 | + "sharded-replicaset", |
| 182 | + "load-balanced" |
| 183 | + ] |
| 184 | + } |
| 185 | + ], |
| 186 | + "operations": [ |
| 187 | + { |
| 188 | + "name": "failPoint", |
| 189 | + "object": "testRunner", |
| 190 | + "arguments": { |
| 191 | + "client": "globalClient", |
| 192 | + "failPoint": { |
| 193 | + "configureFailPoint": "failCommand", |
| 194 | + "mode": { |
| 195 | + "times": 1 |
| 196 | + }, |
| 197 | + "data": { |
| 198 | + "failCommands": [ |
| 199 | + "getMore" |
| 200 | + ], |
| 201 | + "errorCode": 216, |
| 202 | + "closeConnection": false |
| 203 | + } |
| 204 | + } |
| 205 | + } |
| 206 | + }, |
| 207 | + { |
| 208 | + "name": "createChangeStream", |
| 209 | + "object": "collection0", |
| 210 | + "arguments": { |
| 211 | + "pipeline": [] |
| 212 | + }, |
| 213 | + "saveResultAsEntity": "changeStream0" |
| 214 | + }, |
| 215 | + { |
| 216 | + "name": "insertOne", |
| 217 | + "object": "globalCollection0", |
| 218 | + "arguments": { |
| 219 | + "document": { |
| 220 | + "z": 3 |
| 221 | + } |
| 222 | + } |
| 223 | + }, |
| 224 | + { |
| 225 | + "name": "iterateUntilDocumentOrError", |
| 226 | + "object": "changeStream0", |
| 227 | + "expectError": { |
| 228 | + "errorCode": 216 |
| 229 | + } |
| 230 | + } |
| 231 | + ] |
| 232 | + } |
| 233 | + ] |
| 234 | +} |
0 commit comments