Skip to content

Commit 0ad4535

Browse files
CSHARP-3891: Add a load balancer test case for SRV resolving to 0 hosts. (#680)
1 parent 219cc4f commit 0ad4535

File tree

6 files changed

+46
-0
lines changed

6 files changed

+46
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# The TXT record for test20.test.build.10gen.cc contains loadBalanced=true.
2+
# DRIVERS-1721 introduced this test as passing.
3+
uri: "mongodb+srv://test20.test.build.10gen.cc/?directConnection=false"
4+
seeds:
5+
- localhost.test.build.10gen.cc:27017
6+
hosts:
7+
# In LB mode, the driver does not do server discovery, so the hostname does
8+
# not get resolved to localhost:27017.
9+
- localhost.test.build.10gen.cc:27017
10+
options:
11+
loadBalanced: true
12+
ssl: true
13+
directConnection: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"uri": "mongodb+srv://test4.test.build.10gen.cc/?loadBalanced=true",
3+
"seeds": [],
4+
"hosts": [],
5+
"error": true,
6+
"comment": "Should fail because no SRV records are present for this URI."
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
uri: "mongodb+srv://test4.test.build.10gen.cc/?loadBalanced=true"
2+
seeds: []
3+
hosts: []
4+
error: true
5+
comment: Should fail because no SRV records are present for this URI.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# The TXT record for test20.test.build.10gen.cc contains loadBalanced=true.
2+
uri: "mongodb+srv://test20.test.build.10gen.cc/?replicaSet=replset"
3+
seeds: []
4+
hosts: []
5+
error: true
6+
comment: Should fail because loadBalanced=true is incompatible with replicaSet
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
uri: "mongodb+srv://test1.test.build.10gen.cc/?loadBalanced=true"
2+
seeds: []
3+
hosts: []
4+
error: true
5+
comment: Should fail because loadBalanced is true but the SRV record resolves to multiple hosts
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
uri: "mongodb+srv://test20.test.build.10gen.cc/"
2+
seeds:
3+
- localhost.test.build.10gen.cc:27017
4+
hosts:
5+
# In LB mode, the driver does not do server discovery, so the hostname does
6+
# not get resolved to localhost:27017.
7+
- localhost.test.build.10gen.cc:27017
8+
options:
9+
loadBalanced: true
10+
ssl: true

0 commit comments

Comments
 (0)