Skip to content

Commit 25ab418

Browse files
committed
update tests
1 parent a4dd0f1 commit 25ab418

File tree

3 files changed

+10
-57
lines changed

3 files changed

+10
-57
lines changed

test/asynchronous/test_pooling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ async def test_pool_check_backoff(self):
526526
await conn.conn.close()
527527

528528
# Enable backoff.
529-
cx_pool._backoff = 1
529+
cx_pool.backoff()
530530

531531
# Swap pool's address with a bad one.
532532
address, cx_pool.address = cx_pool.address, ("foo.com", 1234)

test/discovery_and_monitoring/unified/auth-network-timeout-error.json

Lines changed: 8 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
"useMultipleMongoses": false,
7272
"observeEvents": [
7373
"commandStartedEvent",
74-
"serverDescriptionChangedEvent",
75-
"poolClearedEvent"
74+
"poolBackoffEvent",
75+
"poolReadyEvent"
7676
],
7777
"uriOptions": {
7878
"retryWrites": false,
@@ -111,9 +111,6 @@
111111
"_id": 4
112112
}
113113
]
114-
},
115-
"expectError": {
116-
"isError": true
117114
}
118115
},
119116
{
@@ -122,11 +119,7 @@
122119
"arguments": {
123120
"client": "client",
124121
"event": {
125-
"serverDescriptionChangedEvent": {
126-
"newDescription": {
127-
"type": "Unknown"
128-
}
129-
}
122+
"poolBackoffEvent": {}
130123
},
131124
"count": 1
132125
}
@@ -137,47 +130,7 @@
137130
"arguments": {
138131
"client": "client",
139132
"event": {
140-
"poolClearedEvent": {}
141-
},
142-
"count": 1
143-
}
144-
},
145-
{
146-
"name": "insertMany",
147-
"object": "collection",
148-
"arguments": {
149-
"documents": [
150-
{
151-
"_id": 5
152-
},
153-
{
154-
"_id": 6
155-
}
156-
]
157-
}
158-
},
159-
{
160-
"name": "assertEventCount",
161-
"object": "testRunner",
162-
"arguments": {
163-
"client": "client",
164-
"event": {
165-
"serverDescriptionChangedEvent": {
166-
"newDescription": {
167-
"type": "Unknown"
168-
}
169-
}
170-
},
171-
"count": 1
172-
}
173-
},
174-
{
175-
"name": "assertEventCount",
176-
"object": "testRunner",
177-
"arguments": {
178-
"client": "client",
179-
"event": {
180-
"poolClearedEvent": {}
133+
"poolReadyEvent": {}
181134
},
182135
"count": 1
183136
}
@@ -194,10 +147,10 @@
194147
"insert": "auth-network-timeout-error",
195148
"documents": [
196149
{
197-
"_id": 5
150+
"_id": 3
198151
},
199152
{
200-
"_id": 6
153+
"_id": 4
201154
}
202155
]
203156
},
@@ -220,10 +173,10 @@
220173
"_id": 2
221174
},
222175
{
223-
"_id": 5
176+
"_id": 3
224177
},
225178
{
226-
"_id": 6
179+
"_id": 4
227180
}
228181
]
229182
}

test/test_pooling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ def test_pool_check_backoff(self):
524524
conn.conn.close()
525525

526526
# Enable backoff.
527-
cx_pool._backoff = 1
527+
cx_pool.backoff()
528528

529529
# Swap pool's address with a bad one.
530530
address, cx_pool.address = cx_pool.address, ("foo.com", 1234)

0 commit comments

Comments
 (0)