Skip to content

Commit 4dbcb88

Browse files
authored
test(NODE-7451): sync spec tests for server selection (#4880)
1 parent 22c6031 commit 4dbcb88

2 files changed

Lines changed: 67 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"topology_description": {
3+
"type": "ReplicaSetWithPrimary",
4+
"servers": [
5+
{
6+
"address": "a:27017",
7+
"avg_rtt_ms": 5,
8+
"type": "RSPrimary"
9+
},
10+
{
11+
"address": "b:27017",
12+
"avg_rtt_ms": 5,
13+
"type": "RSSecondary"
14+
}
15+
]
16+
},
17+
"operation": "read",
18+
"read_preference": {
19+
"mode": "SecondaryPreferred",
20+
"tag_sets": [
21+
{
22+
"data_center": "nyc"
23+
},
24+
{}
25+
]
26+
},
27+
"suitable_servers": [
28+
{
29+
"address": "b:27017",
30+
"avg_rtt_ms": 5,
31+
"type": "RSSecondary"
32+
}
33+
],
34+
"in_latency_window": [
35+
{
36+
"address": "b:27017",
37+
"avg_rtt_ms": 5,
38+
"type": "RSSecondary"
39+
}
40+
]
41+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Attempt to select the secondary using an empty tag set. Expect empty tag set to match.
2+
# This is a regression test for RUST-2363.
3+
---
4+
topology_description:
5+
type: ReplicaSetWithPrimary
6+
servers:
7+
- &1
8+
address: a:27017
9+
avg_rtt_ms: 5
10+
type: RSPrimary
11+
# No "tags".
12+
- &2
13+
address: b:27017
14+
avg_rtt_ms: 5
15+
type: RSSecondary
16+
# No "tags"
17+
operation: read
18+
read_preference:
19+
mode: SecondaryPreferred
20+
tag_sets:
21+
- data_center: nyc # Does not match.
22+
- {} # Empty tag set.
23+
suitable_servers:
24+
- *2
25+
in_latency_window:
26+
- *2

0 commit comments

Comments
 (0)