Skip to content

Commit 8455b76

Browse files
committed
PYTHON-2768 Add SDAM and server selection spec tests for load balancers (#655)
(cherry picked from commit a792160)
1 parent be70d04 commit 8455b76

File tree

15 files changed

+508
-26
lines changed

15 files changed

+508
-26
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"description": "Load balancer can be discovered and only has the address property set",
3+
"uri": "mongodb://a/?loadBalanced=true",
4+
"phases": [
5+
{
6+
"outcome": {
7+
"servers": {
8+
"a:27017": {
9+
"type": "LoadBalancer",
10+
"setName": null,
11+
"setVersion": null,
12+
"electionId": null,
13+
"logicalSessionTimeoutMinutes": null,
14+
"minWireVersion": null,
15+
"maxWireVersion": null,
16+
"topologyVersion": null
17+
}
18+
},
19+
"topologyType": "LoadBalanced",
20+
"setName": null,
21+
"logicalSessionTimeoutMinutes": null,
22+
"maxSetVersion": null,
23+
"maxElectionId": null,
24+
"compatible": true
25+
}
26+
}
27+
]
28+
}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"description": "Monitoring a load balancer",
3+
"uri": "mongodb://a:27017/?loadBalanced=true",
4+
"phases": [
5+
{
6+
"outcome": {
7+
"events": [
8+
{
9+
"topology_opening_event": {
10+
"topologyId": "42"
11+
}
12+
},
13+
{
14+
"topology_description_changed_event": {
15+
"topologyId": "42",
16+
"previousDescription": {
17+
"topologyType": "Unknown",
18+
"servers": []
19+
},
20+
"newDescription": {
21+
"topologyType": "LoadBalanced",
22+
"servers": [
23+
{
24+
"address": "a:27017",
25+
"arbiters": [],
26+
"hosts": [],
27+
"passives": [],
28+
"type": "Unknown"
29+
}
30+
]
31+
}
32+
}
33+
},
34+
{
35+
"server_opening_event": {
36+
"topologyId": "42",
37+
"address": "a:27017"
38+
}
39+
},
40+
{
41+
"server_description_changed_event": {
42+
"topologyId": "42",
43+
"address": "a:27017",
44+
"previousDescription": {
45+
"address": "a:27017",
46+
"arbiters": [],
47+
"hosts": [],
48+
"passives": [],
49+
"type": "Unknown"
50+
},
51+
"newDescription": {
52+
"address": "a:27017",
53+
"arbiters": [],
54+
"hosts": [],
55+
"passives": [],
56+
"type": "LoadBalancer"
57+
}
58+
}
59+
},
60+
{
61+
"topology_description_changed_event": {
62+
"topologyId": "42",
63+
"previousDescription": {
64+
"topologyType": "LoadBalanced",
65+
"servers": [
66+
{
67+
"address": "a:27017",
68+
"arbiters": [],
69+
"hosts": [],
70+
"passives": [],
71+
"type": "Unknown"
72+
}
73+
]
74+
},
75+
"newDescription": {
76+
"topologyType": "LoadBalanced",
77+
"servers": [
78+
{
79+
"address": "a:27017",
80+
"arbiters": [],
81+
"hosts": [],
82+
"passives": [],
83+
"type": "LoadBalancer"
84+
}
85+
]
86+
}
87+
}
88+
}
89+
]
90+
}
91+
}
92+
]
93+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"topology_description": {
3+
"type": "LoadBalanced",
4+
"servers": [
5+
{
6+
"address": "g:27017",
7+
"avg_rtt_ms": 0,
8+
"type": "LoadBalancer"
9+
}
10+
]
11+
},
12+
"operation": "read",
13+
"read_preference": {
14+
"mode": "Nearest",
15+
"tag_sets": [
16+
{
17+
"data_center": "nyc"
18+
}
19+
]
20+
},
21+
"suitable_servers": [
22+
{
23+
"address": "g:27017",
24+
"avg_rtt_ms": 0,
25+
"type": "LoadBalancer"
26+
}
27+
],
28+
"in_latency_window": [
29+
{
30+
"address": "g:27017",
31+
"avg_rtt_ms": 0,
32+
"type": "LoadBalancer"
33+
}
34+
]
35+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"topology_description": {
3+
"type": "LoadBalanced",
4+
"servers": [
5+
{
6+
"address": "g:27017",
7+
"avg_rtt_ms": 0,
8+
"type": "LoadBalancer"
9+
}
10+
]
11+
},
12+
"operation": "read",
13+
"read_preference": {
14+
"mode": "Primary"
15+
},
16+
"suitable_servers": [
17+
{
18+
"address": "g:27017",
19+
"avg_rtt_ms": 0,
20+
"type": "LoadBalancer"
21+
}
22+
],
23+
"in_latency_window": [
24+
{
25+
"address": "g:27017",
26+
"avg_rtt_ms": 0,
27+
"type": "LoadBalancer"
28+
}
29+
]
30+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"topology_description": {
3+
"type": "LoadBalanced",
4+
"servers": [
5+
{
6+
"address": "g:27017",
7+
"avg_rtt_ms": 0,
8+
"type": "LoadBalancer"
9+
}
10+
]
11+
},
12+
"operation": "read",
13+
"read_preference": {
14+
"mode": "PrimaryPreferred",
15+
"tag_sets": [
16+
{
17+
"data_center": "nyc"
18+
}
19+
]
20+
},
21+
"suitable_servers": [
22+
{
23+
"address": "g:27017",
24+
"avg_rtt_ms": 0,
25+
"type": "LoadBalancer"
26+
}
27+
],
28+
"in_latency_window": [
29+
{
30+
"address": "g:27017",
31+
"avg_rtt_ms": 0,
32+
"type": "LoadBalancer"
33+
}
34+
]
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"topology_description": {
3+
"type": "LoadBalanced",
4+
"servers": [
5+
{
6+
"address": "g:27017",
7+
"avg_rtt_ms": 0,
8+
"type": "LoadBalancer"
9+
}
10+
]
11+
},
12+
"operation": "read",
13+
"read_preference": {
14+
"mode": "Secondary",
15+
"tag_sets": [
16+
{
17+
"data_center": "nyc"
18+
}
19+
]
20+
},
21+
"suitable_servers": [
22+
{
23+
"address": "g:27017",
24+
"avg_rtt_ms": 0,
25+
"type": "LoadBalancer"
26+
}
27+
],
28+
"in_latency_window": [
29+
{
30+
"address": "g:27017",
31+
"avg_rtt_ms": 0,
32+
"type": "LoadBalancer"
33+
}
34+
]
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"topology_description": {
3+
"type": "LoadBalanced",
4+
"servers": [
5+
{
6+
"address": "g:27017",
7+
"avg_rtt_ms": 0,
8+
"type": "LoadBalancer"
9+
}
10+
]
11+
},
12+
"operation": "read",
13+
"read_preference": {
14+
"mode": "SecondaryPreferred",
15+
"tag_sets": [
16+
{
17+
"data_center": "nyc"
18+
}
19+
]
20+
},
21+
"suitable_servers": [
22+
{
23+
"address": "g:27017",
24+
"avg_rtt_ms": 0,
25+
"type": "LoadBalancer"
26+
}
27+
],
28+
"in_latency_window": [
29+
{
30+
"address": "g:27017",
31+
"avg_rtt_ms": 0,
32+
"type": "LoadBalancer"
33+
}
34+
]
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"topology_description": {
3+
"type": "LoadBalanced",
4+
"servers": [
5+
{
6+
"address": "g:27017",
7+
"avg_rtt_ms": 0,
8+
"type": "LoadBalancer"
9+
}
10+
]
11+
},
12+
"operation": "write",
13+
"read_preference": {
14+
"mode": "Nearest",
15+
"tag_sets": [
16+
{
17+
"data_center": "nyc"
18+
}
19+
]
20+
},
21+
"suitable_servers": [
22+
{
23+
"address": "g:27017",
24+
"avg_rtt_ms": 0,
25+
"type": "LoadBalancer"
26+
}
27+
],
28+
"in_latency_window": [
29+
{
30+
"address": "g:27017",
31+
"avg_rtt_ms": 0,
32+
"type": "LoadBalancer"
33+
}
34+
]
35+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"topology_description": {
3+
"type": "LoadBalanced",
4+
"servers": [
5+
{
6+
"address": "g:27017",
7+
"avg_rtt_ms": 0,
8+
"type": "LoadBalancer"
9+
}
10+
]
11+
},
12+
"operation": "write",
13+
"read_preference": {
14+
"mode": "Primary"
15+
},
16+
"suitable_servers": [
17+
{
18+
"address": "g:27017",
19+
"avg_rtt_ms": 0,
20+
"type": "LoadBalancer"
21+
}
22+
],
23+
"in_latency_window": [
24+
{
25+
"address": "g:27017",
26+
"avg_rtt_ms": 0,
27+
"type": "LoadBalancer"
28+
}
29+
]
30+
}

0 commit comments

Comments
 (0)