Skip to content

Commit 5a6279a

Browse files
authored
test(NODE-3284): add maxPoolSize=0 spec tests (#2830)
1 parent 03737b6 commit 5a6279a

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

test/spec/uri-options/connection-pool-options.json

+26-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
"tests": [
33
{
44
"description": "Valid connection pool options are parsed correctly",
5-
"uri": "mongodb://example.com/?maxIdleTimeMS=50000",
5+
"uri": "mongodb://example.com/?maxIdleTimeMS=50000&maxPoolSize=5&minPoolSize=3",
66
"valid": true,
77
"warning": false,
88
"hosts": null,
99
"auth": null,
1010
"options": {
11-
"maxIdleTimeMS": 50000
11+
"maxIdleTimeMS": 50000,
12+
"maxPoolSize": 5,
13+
"minPoolSize": 3
1214
}
1315
},
1416
{
@@ -28,6 +30,28 @@
2830
"hosts": null,
2931
"auth": null,
3032
"options": {}
33+
},
34+
{
35+
"description": "maxPoolSize=0 does not error",
36+
"uri": "mongodb://example.com/?maxPoolSize=0",
37+
"valid": true,
38+
"warning": false,
39+
"hosts": null,
40+
"auth": null,
41+
"options": {
42+
"maxPoolSize": 0
43+
}
44+
},
45+
{
46+
"description": "minPoolSize=0 does not error",
47+
"uri": "mongodb://example.com/?minPoolSize=0",
48+
"valid": true,
49+
"warning": false,
50+
"hosts": null,
51+
"auth": null,
52+
"options": {
53+
"minPoolSize": 0
54+
}
3155
}
3256
]
3357
}

test/spec/uri-options/connection-pool-options.yml

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
tests:
22
-
33
description: "Valid connection pool options are parsed correctly"
4-
uri: "mongodb://example.com/?maxIdleTimeMS=50000"
4+
uri: "mongodb://example.com/?maxIdleTimeMS=50000&maxPoolSize=5&minPoolSize=3"
55
valid: true
66
warning: false
77
hosts: ~
88
auth: ~
99
options:
1010
maxIdleTimeMS: 50000
11+
maxPoolSize: 5
12+
minPoolSize: 3
1113
-
1214
description: "Non-numeric maxIdleTimeMS causes a warning"
1315
uri: "mongodb://example.com/?maxIdleTimeMS=invalid"
@@ -24,3 +26,23 @@ tests:
2426
hosts: ~
2527
auth: ~
2628
options: {}
29+
30+
-
31+
description: "maxPoolSize=0 does not error"
32+
uri: "mongodb://example.com/?maxPoolSize=0"
33+
valid: true
34+
warning: false
35+
hosts: ~
36+
auth: ~
37+
options:
38+
maxPoolSize: 0
39+
40+
-
41+
description: "minPoolSize=0 does not error"
42+
uri: "mongodb://example.com/?minPoolSize=0"
43+
valid: true
44+
warning: false
45+
hosts: ~
46+
auth: ~
47+
options:
48+
minPoolSize: 0

0 commit comments

Comments
 (0)