Skip to content

Commit f17f5e2

Browse files
authored
PYTHON-4379 Test that durations are included on relevant pool events (mongodb#1765)
1 parent 682f15b commit f17f5e2

9 files changed

+35
-17
lines changed

test/connection_monitoring/pool-checkin-make-available.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
{
2323
"type": "ConnectionCheckedOut",
2424
"connectionId": 1,
25-
"address": 42
25+
"address": 42,
26+
"duration": 42
2627
},
2728
{
2829
"type": "ConnectionCheckedIn",
@@ -32,7 +33,8 @@
3233
{
3334
"type": "ConnectionCheckedOut",
3435
"connectionId": 1,
35-
"address": 42
36+
"address": 42,
37+
"duration": 42
3638
}
3739
],
3840
"ignore": [

test/connection_monitoring/pool-checkout-connection.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@
2323
{
2424
"type": "ConnectionReady",
2525
"connectionId": 1,
26-
"address": 42
26+
"address": 42,
27+
"duration": 42
2728
},
2829
{
2930
"type": "ConnectionCheckedOut",
3031
"connectionId": 1,
31-
"address": 42
32+
"address": 42,
33+
"duration": 42
3234
}
3335
],
3436
"ignore": [

test/connection_monitoring/pool-checkout-error-closed.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
{
3939
"type": "ConnectionCheckedOut",
4040
"address": 42,
41-
"connectionId": 42
41+
"connectionId": 42,
42+
"duration": 42
4243
},
4344
{
4445
"type": "ConnectionCheckedIn",
@@ -56,6 +57,7 @@
5657
{
5758
"type": "ConnectionCheckOutFailed",
5859
"address": 42,
60+
"duration": 42,
5961
"reason": "poolClosed"
6062
}
6163
],

test/connection_monitoring/pool-checkout-maxConnecting-timeout.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@
8989
{
9090
"type": "ConnectionCheckOutFailed",
9191
"reason": "timeout",
92-
"address": 42
92+
"address": 42,
93+
"duration": 42
9394
}
9495
],
9596
"ignore": [

test/connection_monitoring/pool-clear-clears-waitqueue.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
},
6060
{
6161
"type": "ConnectionCheckedOut",
62-
"address": 42
62+
"address": 42,
63+
"duration": 42
6364
},
6465
{
6566
"type": "ConnectionCheckOutStarted",
@@ -76,17 +77,20 @@
7677
{
7778
"type": "ConnectionCheckOutFailed",
7879
"reason": "connectionError",
79-
"address": 42
80+
"address": 42,
81+
"duration": 42
8082
},
8183
{
8284
"type": "ConnectionCheckOutFailed",
8385
"reason": "connectionError",
84-
"address": 42
86+
"address": 42,
87+
"duration": 42
8588
},
8689
{
8790
"type": "ConnectionCheckOutFailed",
8891
"reason": "connectionError",
89-
"address": 42
92+
"address": 42,
93+
"duration": 42
9094
}
9195
],
9296
"ignore": [

test/connection_monitoring/pool-clear-interrupting-pending-connections.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"closeConnection": false,
1919
"blockConnection": true,
20-
"blockTimeMS": 1000
20+
"blockTimeMS": 10000
2121
}
2222
},
2323
"poolOptions": {

test/connection_monitoring/pool-clear-ready.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
{
4141
"type": "ConnectionCheckedOut",
4242
"address": 42,
43-
"connectionId": 42
43+
"connectionId": 42,
44+
"duration": 42
4445
},
4546
{
4647
"type": "ConnectionPoolCleared",
@@ -49,6 +50,7 @@
4950
{
5051
"type": "ConnectionCheckOutFailed",
5152
"address": 42,
53+
"duration": 42,
5254
"reason": "connectionError"
5355
},
5456
{
@@ -57,7 +59,8 @@
5759
},
5860
{
5961
"type": "ConnectionCheckedOut",
60-
"address": 42
62+
"address": 42,
63+
"duration": 42
6164
}
6265
],
6366
"ignore": [

test/connection_monitoring/pool-ready.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
{
3232
"type": "ConnectionCheckOutFailed",
3333
"reason": "connectionError",
34-
"address": 42
34+
"address": 42,
35+
"duration": 42
3536
},
3637
{
3738
"type": "ConnectionPoolReady",
@@ -47,7 +48,8 @@
4748
},
4849
{
4950
"type": "ConnectionCheckedOut",
50-
"address": 42
51+
"address": 42,
52+
"duration": 42
5153
}
5254
],
5355
"ignore": [

test/connection_monitoring/wait-queue-timeout.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
{
4949
"type": "ConnectionCheckedOut",
5050
"connectionId": 42,
51-
"address": 42
51+
"address": 42,
52+
"duration": 42
5253
},
5354
{
5455
"type": "ConnectionCheckOutStarted",
@@ -57,7 +58,8 @@
5758
{
5859
"type": "ConnectionCheckOutFailed",
5960
"reason": "timeout",
60-
"address": 42
61+
"address": 42,
62+
"duration": 42
6163
},
6264
{
6365
"type": "ConnectionCheckedIn",

0 commit comments

Comments
 (0)