Skip to content

Commit 476c373

Browse files
committed
add connection-logging-pool-backoff tests
1 parent d72f279 commit 476c373

File tree

2 files changed

+382
-361
lines changed

2 files changed

+382
-361
lines changed
Lines changed: 379 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,379 @@
1+
{
2+
"description": "connection-logging",
3+
"schemaVersion": "1.28",
4+
"runOnRequirements": [
5+
{
6+
"topologies": [
7+
"single"
8+
],
9+
"poolBackoff": true
10+
}
11+
],
12+
"createEntities": [
13+
{
14+
"client": {
15+
"id": "failPointClient"
16+
}
17+
}
18+
],
19+
"tests": [
20+
{
21+
"description": "Connection enters backoff on closed connection",
22+
"runOnRequirements": [
23+
{
24+
"minServerVersion": "4.4",
25+
"poolBackoff": true
26+
}
27+
],
28+
"operations": [
29+
{
30+
"name": "createEntities",
31+
"object": "testRunner",
32+
"arguments": {
33+
"entities": [
34+
{
35+
"client": {
36+
"id": "client",
37+
"uriOptions": {
38+
"retryReads": true,
39+
"appname": "clientAppName",
40+
"heartbeatFrequencyMS": 5000
41+
},
42+
"observeEvents": [
43+
"serverHeartbeatSucceededEvent"
44+
],
45+
"observeLogMessages": {
46+
"connection": "debug"
47+
}
48+
}
49+
},
50+
{
51+
"database": {
52+
"id": "database0",
53+
"client": "client",
54+
"databaseName": "ci-tests"
55+
}
56+
}
57+
]
58+
}
59+
},
60+
{
61+
"name": "waitForEvent",
62+
"object": "testRunner",
63+
"arguments": {
64+
"client": "client",
65+
"event": {
66+
"serverHeartbeatSucceededEvent": {}
67+
},
68+
"count": 1
69+
}
70+
},
71+
{
72+
"name": "failPoint",
73+
"object": "testRunner",
74+
"arguments": {
75+
"client": "failPointClient",
76+
"failPoint": {
77+
"configureFailPoint": "failCommand",
78+
"mode": {
79+
"times": 1
80+
},
81+
"data": {
82+
"failCommands": [
83+
"isMaster",
84+
"hello"
85+
],
86+
"closeConnection": true,
87+
"appName": "clientAppName"
88+
}
89+
}
90+
}
91+
},
92+
{
93+
"object": "database0",
94+
"name": "runCommand",
95+
"arguments": {
96+
"command": {
97+
"find": "test"
98+
},
99+
"commandName": "find"
100+
}
101+
}
102+
],
103+
"expectLogMessages": [
104+
{
105+
"client": "client",
106+
"messages": [
107+
{
108+
"level": "debug",
109+
"component": "connection",
110+
"data": {
111+
"message": "Connection pool created",
112+
"serverHost": {
113+
"$$type": "string"
114+
},
115+
"serverPort": {
116+
"$$type": [
117+
"int",
118+
"long"
119+
]
120+
}
121+
}
122+
},
123+
{
124+
"level": "debug",
125+
"component": "connection",
126+
"data": {
127+
"message": "Connection pool ready",
128+
"serverHost": {
129+
"$$type": "string"
130+
},
131+
"serverPort": {
132+
"$$type": [
133+
"int",
134+
"long"
135+
]
136+
}
137+
}
138+
},
139+
{
140+
"level": "debug",
141+
"component": "connection",
142+
"data": {
143+
"message": "Connection checkout started",
144+
"serverHost": {
145+
"$$type": "string"
146+
},
147+
"serverPort": {
148+
"$$type": [
149+
"int",
150+
"long"
151+
]
152+
}
153+
}
154+
},
155+
{
156+
"level": "debug",
157+
"component": "connection",
158+
"data": {
159+
"message": "Connection created",
160+
"driverConnectionId": {
161+
"$$type": [
162+
"int",
163+
"long"
164+
]
165+
},
166+
"serverHost": {
167+
"$$type": "string"
168+
},
169+
"serverPort": {
170+
"$$type": [
171+
"int",
172+
"long"
173+
]
174+
}
175+
}
176+
},
177+
{
178+
"level": "debug",
179+
"component": "connection",
180+
"data": {
181+
"message": "Connection closed",
182+
"driverConnectionId": {
183+
"$$type": [
184+
"int",
185+
"long"
186+
]
187+
},
188+
"serverHost": {
189+
"$$type": "string"
190+
},
191+
"serverPort": {
192+
"$$type": [
193+
"int",
194+
"long"
195+
]
196+
},
197+
"reason": "An error occurred while using the connection",
198+
"error": {
199+
"$$exists": true
200+
}
201+
}
202+
},
203+
{
204+
"level": "debug",
205+
"component": "connection",
206+
"data": {
207+
"message": "Connection pool backoff",
208+
"serverHost": {
209+
"$$type": "string"
210+
},
211+
"durationMS": {
212+
"$$type": "int"
213+
},
214+
"attempt": {
215+
"$$type": "int"
216+
},
217+
"serverPort": {
218+
"$$type": [
219+
"int",
220+
"long"
221+
]
222+
},
223+
"reason": "Connection pool is in backoff",
224+
"error": {
225+
"$$exists": true
226+
}
227+
}
228+
},
229+
{
230+
"level": "debug",
231+
"component": "connection",
232+
"data": {
233+
"message": "Connection checkout failed",
234+
"serverHost": {
235+
"$$type": "string"
236+
},
237+
"serverPort": {
238+
"$$type": [
239+
"int",
240+
"long"
241+
]
242+
},
243+
"reason": "An error occurred while trying to establish a new connection",
244+
"error": {
245+
"$$exists": true
246+
},
247+
"durationMS": {
248+
"$$type": [
249+
"double",
250+
"int",
251+
"long"
252+
]
253+
}
254+
}
255+
},
256+
{
257+
"level": "debug",
258+
"component": "connection",
259+
"data": {
260+
"message": "Connection checkout started",
261+
"serverHost": {
262+
"$$type": "string"
263+
},
264+
"serverPort": {
265+
"$$type": [
266+
"int",
267+
"long"
268+
]
269+
}
270+
}
271+
},
272+
{
273+
"level": "debug",
274+
"component": "connection",
275+
"data": {
276+
"message": "Connection created",
277+
"driverConnectionId": {
278+
"$$type": [
279+
"int",
280+
"long"
281+
]
282+
},
283+
"serverHost": {
284+
"$$type": "string"
285+
},
286+
"serverPort": {
287+
"$$type": [
288+
"int",
289+
"long"
290+
]
291+
}
292+
}
293+
},
294+
{
295+
"level": "debug",
296+
"component": "connection",
297+
"data": {
298+
"message": "Connection ready",
299+
"driverConnectionId": {
300+
"$$type": [
301+
"int",
302+
"long"
303+
]
304+
},
305+
"serverHost": {
306+
"$$type": "string"
307+
},
308+
"serverPort": {
309+
"$$type": [
310+
"int",
311+
"long"
312+
]
313+
},
314+
"durationMS": {
315+
"$$type": [
316+
"double",
317+
"int",
318+
"long"
319+
]
320+
}
321+
}
322+
},
323+
{
324+
"level": "debug",
325+
"component": "connection",
326+
"data": {
327+
"message": "Connection checked out",
328+
"driverConnectionId": {
329+
"$$type": [
330+
"int",
331+
"long"
332+
]
333+
},
334+
"serverHost": {
335+
"$$type": "string"
336+
},
337+
"serverPort": {
338+
"$$type": [
339+
"int",
340+
"long"
341+
]
342+
},
343+
"durationMS": {
344+
"$$type": [
345+
"double",
346+
"int",
347+
"long"
348+
]
349+
}
350+
}
351+
},
352+
{
353+
"level": "debug",
354+
"component": "connection",
355+
"data": {
356+
"message": "Connection checked in",
357+
"driverConnectionId": {
358+
"$$type": [
359+
"int",
360+
"long"
361+
]
362+
},
363+
"serverHost": {
364+
"$$type": "string"
365+
},
366+
"serverPort": {
367+
"$$type": [
368+
"int",
369+
"long"
370+
]
371+
}
372+
}
373+
}
374+
]
375+
}
376+
]
377+
}
378+
]
379+
}

0 commit comments

Comments
 (0)