Skip to content

Commit 105ef73

Browse files
committed
PYTHON-2395 Resync spec tests again
1 parent f04c7f4 commit 105ef73

11 files changed

+164
-131
lines changed

test/server_selection/in_window/equilibrium.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121
]
2222
},
23-
"in_window": [
23+
"mocked_topology_state": [
2424
{
2525
"address": "a:27017",
2626
"operation_count": 5
@@ -34,9 +34,13 @@
3434
"operation_count": 5
3535
}
3636
],
37-
"expected_frequencies": {
38-
"a:27017": 0.33,
39-
"b:27017": 0.33,
40-
"c:27017": 0.33
37+
"iterations": 2000,
38+
"outcome": {
39+
"tolerance": 0.05,
40+
"expected_frequencies": {
41+
"a:27017": 0.33,
42+
"b:27017": 0.33,
43+
"c:27017": 0.33
44+
}
4145
}
4246
}

test/server_selection/in_window/many-choices.json

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
}
5151
]
5252
},
53-
"in_window": [
53+
"mocked_topology_state": [
5454
{
5555
"address": "a:27017",
5656
"operation_count": 0
@@ -88,15 +88,19 @@
8888
"operation_count": 60
8989
}
9090
],
91-
"expected_frequencies": {
92-
"a:27017": 0.22,
93-
"b:27017": 0.18,
94-
"c:27017": 0.18,
95-
"d:27017": 0.125,
96-
"e:27017": 0.125,
97-
"f:27017": 0.074,
98-
"g:27017": 0.074,
99-
"h:27017": 0.0277,
100-
"i:27017": 0
91+
"iterations": 10000,
92+
"outcome": {
93+
"tolerance": 0.03,
94+
"expected_frequencies": {
95+
"a:27017": 0.22,
96+
"b:27017": 0.18,
97+
"c:27017": 0.18,
98+
"d:27017": 0.125,
99+
"e:27017": 0.125,
100+
"f:27017": 0.074,
101+
"g:27017": 0.074,
102+
"h:27017": 0.0277,
103+
"i:27017": 0
104+
}
101105
}
102106
}

test/server_selection/in_window/maxConnecting-waitQueue.json

Lines changed: 0 additions & 42 deletions
This file was deleted.

test/server_selection/in_window/one-least-two-tied.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121
]
2222
},
23-
"in_window": [
23+
"mocked_topology_state": [
2424
{
2525
"address": "a:27017",
2626
"operation_count": 16
@@ -34,9 +34,13 @@
3434
"operation_count": 16
3535
}
3636
],
37-
"expected_frequencies": {
38-
"a:27017": 0.165,
39-
"b:27017": 0.66,
40-
"c:27017": 0.165
37+
"iterations": 2000,
38+
"outcome": {
39+
"tolerance": 0.05,
40+
"expected_frequencies": {
41+
"a:27017": 0.165,
42+
"b:27017": 0.66,
43+
"c:27017": 0.165
44+
}
4145
}
4246
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"description": "When in equilibrium selection is evenly distributed (replica set)",
3+
"topology_description": {
4+
"type": "ReplicaSetWithPrimary",
5+
"servers": [
6+
{
7+
"address": "a:27017",
8+
"avg_rtt_ms": 35,
9+
"type": "RSPrimary"
10+
},
11+
{
12+
"address": "b:27017",
13+
"avg_rtt_ms": 35,
14+
"type": "RSSecondary"
15+
},
16+
{
17+
"address": "c:27017",
18+
"avg_rtt_ms": 35,
19+
"type": "RSSecondary"
20+
}
21+
]
22+
},
23+
"mocked_topology_state": [
24+
{
25+
"address": "a:27017",
26+
"operation_count": 6
27+
},
28+
{
29+
"address": "b:27017",
30+
"operation_count": 6
31+
},
32+
{
33+
"address": "c:27017",
34+
"operation_count": 6
35+
}
36+
],
37+
"iterations": 2000,
38+
"outcome": {
39+
"tolerance": 0.05,
40+
"expected_frequencies": {
41+
"a:27017": 0.33,
42+
"b:27017": 0.33,
43+
"c:27017": 0.33
44+
}
45+
}
46+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"description": "Selections from three servers occur at proper distributions (replica set)",
3+
"topology_description": {
4+
"type": "ReplicaSetWithPrimary",
5+
"servers": [
6+
{
7+
"address": "a:27017",
8+
"avg_rtt_ms": 35,
9+
"type": "RSPrimary"
10+
},
11+
{
12+
"address": "b:27017",
13+
"avg_rtt_ms": 35,
14+
"type": "RSSecondary"
15+
},
16+
{
17+
"address": "c:27017",
18+
"avg_rtt_ms": 35,
19+
"type": "RSSecondary"
20+
}
21+
]
22+
},
23+
"mocked_topology_state": [
24+
{
25+
"address": "a:27017",
26+
"operation_count": 3
27+
},
28+
{
29+
"address": "b:27017",
30+
"operation_count": 6
31+
},
32+
{
33+
"address": "c:27017",
34+
"operation_count": 20
35+
}
36+
],
37+
"iterations": 2000,
38+
"outcome": {
39+
"tolerance": 0.05,
40+
"expected_frequencies": {
41+
"a:27017": 0.66,
42+
"b:27017": 0.33,
43+
"c:27017": 0
44+
}
45+
}
46+
}

test/server_selection/in_window/saturated-pools.json

Lines changed: 0 additions & 42 deletions
This file was deleted.

test/server_selection/in_window/three-choices.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"description": "Server with least connections and most available connections selected most",
2+
"description": "Selections from three servers occur at proper distributions",
33
"topology_description": {
44
"type": "Sharded",
55
"servers": [
@@ -20,7 +20,7 @@
2020
}
2121
]
2222
},
23-
"in_window": [
23+
"mocked_topology_state": [
2424
{
2525
"address": "a:27017",
2626
"operation_count": 3
@@ -34,9 +34,13 @@
3434
"operation_count": 20
3535
}
3636
],
37-
"expected_frequencies": {
38-
"a:27017": 0.66,
39-
"b:27017": 0.33,
40-
"c:27017": 0
37+
"iterations": 2000,
38+
"outcome": {
39+
"tolerance": 0.05,
40+
"expected_frequencies": {
41+
"a:27017": 0.66,
42+
"b:27017": 0.33,
43+
"c:27017": 0
44+
}
4145
}
4246
}

test/server_selection/in_window/two-choices.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616
]
1717
},
18-
"in_window": [
18+
"mocked_topology_state": [
1919
{
2020
"address": "a:27017",
2121
"operation_count": 0
@@ -25,8 +25,12 @@
2525
"operation_count": 5
2626
}
2727
],
28-
"expected_frequencies": {
29-
"a:27017": 1,
30-
"b:27017": 0
28+
"iterations": 100,
29+
"outcome": {
30+
"tolerance": 0,
31+
"expected_frequencies": {
32+
"a:27017": 1,
33+
"b:27017": 0
34+
}
3135
}
3236
}

test/server_selection/in_window/two-least.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121
]
2222
},
23-
"in_window": [
23+
"mocked_topology_state": [
2424
{
2525
"address": "a:27017",
2626
"operation_count": 10
@@ -34,9 +34,13 @@
3434
"operation_count": 16
3535
}
3636
],
37-
"expected_frequencies": {
38-
"a:27017": 0.5,
39-
"b:27017": 0.5,
40-
"c:27017": 0
37+
"iterations": 2000,
38+
"outcome": {
39+
"tolerance": 0.05,
40+
"expected_frequencies": {
41+
"a:27017": 0.5,
42+
"b:27017": 0.5,
43+
"c:27017": 0
44+
}
4145
}
4246
}

0 commit comments

Comments
 (0)