| 1 | { |
| 2 | "description": "connection establishment if loadBalanced is specified for non-load balanced clusters", |
| 3 | "schemaVersion": "1.3", |
| 4 | "runOnRequirements": [ |
| 5 | { |
| 6 | "topologies": [ |
| 7 | "single", |
| 8 | "sharded" |
| 9 | ] |
| 10 | } |
| 11 | ], |
| 12 | "createEntities": [ |
| 13 | { |
| 14 | "client": { |
| 15 | "id": "lbTrueClient", |
| 16 | "useMultipleMongoses": false, |
| 17 | "uriOptions": { |
| 18 | "loadBalanced": true |
| 19 | } |
| 20 | } |
| 21 | }, |
| 22 | { |
| 23 | "database": { |
| 24 | "id": "lbTrueDatabase", |
| 25 | "client": "lbTrueClient", |
| 26 | "databaseName": "lbTrueDb" |
| 27 | } |
| 28 | }, |
| 29 | { |
| 30 | "client": { |
| 31 | "id": "lbFalseClient", |
| 32 | "uriOptions": { |
| 33 | "loadBalanced": false |
| 34 | } |
| 35 | } |
| 36 | }, |
| 37 | { |
| 38 | "database": { |
| 39 | "id": "lbFalseDatabase", |
| 40 | "client": "lbFalseClient", |
| 41 | "databaseName": "lbFalseDb" |
| 42 | } |
| 43 | } |
| 44 | ], |
| 45 | "_yamlAnchors": { |
| 46 | "runCommandArguments": [ |
| 47 | { |
| 48 | "arguments": { |
| 49 | "commandName": "ping", |
| 50 | "command": { |
| 51 | "ping": 1 |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | ] |
| 56 | }, |
| 57 | "tests": [ |
| 58 | { |
| 59 | "description": "operations against non-load balanced clusters fail if URI contains loadBalanced=true", |
| 60 | "operations": [ |
| 61 | { |
| 62 | "name": "runCommand", |
| 63 | "object": "lbTrueDatabase", |
| 64 | "arguments": { |
| 65 | "commandName": "ping", |
| 66 | "command": { |
| 67 | "ping": 1 |
| 68 | } |
| 69 | }, |
| 70 | "expectError": { |
| 71 | "errorContains": "Driver attempted to initialize in load balancing mode, but the server does not support this mode" |
| 72 | } |
| 73 | } |
| 74 | ] |
| 75 | }, |
| 76 | { |
| 77 | "description": "operations against non-load balanced clusters succeed if URI contains loadBalanced=false", |
| 78 | "operations": [ |
| 79 | { |
| 80 | "name": "runCommand", |
| 81 | "object": "lbFalseDatabase", |
| 82 | "arguments": { |
| 83 | "commandName": "ping", |
| 84 | "command": { |
| 85 | "ping": 1 |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | ] |
| 90 | } |
| 91 | ] |
| 92 | } |