@@ -110,48 +110,80 @@ Before each test case, perform the setup.
110
110
| version | 1.2 |
111
111
| platform | Library Platform |
112
112
113
- 2 . Send a ` ping ` command to the server and verify:
114
-
115
- - The command succeeds.
116
- - The wrapping library metadata is appended to the respective ` client.driver ` fields of the ` hello ` command.
113
+ 2 . Send a ` ping ` command to the server and verify that the command succeeds.
117
114
118
115
3 . Save intercepted ` client ` document as ` initialClientMetadata ` .
119
116
120
117
4 . Wait 5ms for the connection to become idle.
121
118
122
119
#### Parameterized test cases
123
120
124
- ** Case 1**
121
+ | Case | Name | Version | Platform |
122
+ | ---- | --------- | ------- | ------------------ |
123
+ | 1 | framework | 2.0 | Framework Platform |
124
+ | 2 | framework | 2.0 | null |
125
+ | 3 | framework | null | Framework Platform |
126
+ | 4 | framework | null | null |
127
+
128
+ #### Running a test case
129
+
130
+ 1 . Append the ` DriverInfoOptions ` from the selected test case to the ` MongoClient ` metadata.
131
+
132
+ 2 . Send a ` ping ` command to the server and verify:
133
+
134
+ - The command succeeds.
135
+
136
+ - The framework metadata is appended to the existing ` DriverInfoOptions ` in the ` client.driver ` fields of the ` hello `
137
+ command, with values separated by a pipe ` | ` .
138
+
139
+ - ` client.driver.name ` :
140
+ - If test case's name is non-null: ` library|<name> `
141
+ - Otherwise, the field remains unchanged: ` library `
142
+ - ` client.driver.version ` :
143
+ - If test case's version is non-null: ` 1.2|<version> `
144
+ - Otherwise, the field remains unchanged: ` 1.2 `
145
+ - ` client.driver.platform ` :
146
+ - If test case's platform is non-null: ` Library Platform|<platform> `
147
+ - Otherwise, the field remains unchanged: ` Library Platform `
148
+
149
+ - All other subfields in the ` client ` document remain unchanged from ` initialClientMetadata ` .
125
150
126
- | Field | Value |
127
- | -------- | ------------------ |
128
- | name | framework |
129
- | version | 2.0 |
130
- | platform | Framework Platform |
151
+ ## Test 2: Multiple Successive Metadata Updates
131
152
132
- ** Case 2**
153
+ Drivers should verify that after ` MongoClient ` initialization, metadata can be updated multiple times, not replaced, and
154
+ is visible in the ` hello ` command of new connections.
133
155
134
- | Field | Value |
135
- | -------- | --------- |
136
- | name | framework |
137
- | version | 2.0 |
138
- | platform | null |
156
+ There are multiple test cases parameterized with ` DriverInfoOptions ` to be appended after a previous metadata update.
157
+ Before each test case, perform the setup.
139
158
140
- ** Case 3 **
159
+ ### Setup
141
160
142
- | Field | Value |
143
- | -------- | ------------------ |
144
- | name | framework |
145
- | version | null |
146
- | platform | Framework Platform |
161
+ 1 . Create a ` MongoClient ` instance with:
147
162
148
- ** Case 4 **
163
+ - ` maxIdleTimeMS ` set to ` 1ms `
149
164
150
- | Field | Value |
151
- | -------- | --------- |
152
- | name | framework |
153
- | version | null |
154
- | platform | null |
165
+ 2 . Append the following ` DriverInfoOptions ` to the ` MongoClient ` metadata:
166
+
167
+ | Field | Value |
168
+ | -------- | ---------------- |
169
+ | name | library |
170
+ | version | 1.2 |
171
+ | platform | Library Platform |
172
+
173
+ 3 . Send a ` ping ` command to the server and verify that the command succeeds.
174
+
175
+ 4 . Save intercepted ` client ` document as ` updatedClientMetadata ` .
176
+
177
+ 5 . Wait 5ms for the connection to become idle.
178
+
179
+ #### Parameterized test cases
180
+
181
+ | Case | Name | Version | Platform |
182
+ | ---- | --------- | ------- | ------------------ |
183
+ | 1 | framework | 2.0 | Framework Platform |
184
+ | 2 | framework | 2.0 | null |
185
+ | 3 | framework | null | Framework Platform |
186
+ | 4 | framework | null | null |
155
187
156
188
#### Running a test case
157
189
@@ -174,9 +206,9 @@ Before each test case, perform the setup.
174
206
- If test case's platform is non-null: ` Library Platform|<platform> `
175
207
- Otherwise, the field remains unchanged: ` Library Platform `
176
208
177
- - All other subfields in the ` client ` document remain unchanged from ` initialClientMetadata ` .
209
+ - All other subfields in the ` client ` document remain unchanged from ` updatedClientMetadata ` .
178
210
179
- ### Test 2 : Test that metadata is not updated on established connections
211
+ ### Test 3 : Test that metadata is not updated on established connections
180
212
181
213
Drivers should verify that appending metadata after ` MongoClient ` initialization does ** not** close existing
182
214
connections, and that no new ` hello ` command is sent.
0 commit comments