Skip to content

Commit 746e8d5

Browse files
committed
update test
1 parent 7dfc3f1 commit 746e8d5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/asynchronous/test_server_selection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ async def test_selector_called(self):
130130
test_collection = mongo_client.testdb.test_collection
131131
self.addAsyncCleanup(mongo_client.drop_database, "testdb")
132132

133-
# Do N operations and test selector is called at least N times.
133+
# Do N operations and test selector is called at least N-1 times due to fast path.
134134
await test_collection.insert_one({"age": 20, "name": "John"})
135135
await test_collection.insert_one({"age": 31, "name": "Jane"})
136136
await test_collection.update_one({"name": "Jane"}, {"$set": {"age": 21}})
137137
await test_collection.find_one({"name": "Roe"})
138-
self.assertGreaterEqual(selector.call_count, 4)
138+
self.assertGreaterEqual(selector.call_count, 3)
139139

140140
@async_client_context.require_replica_set
141141
async def test_latency_threshold_application(self):

test/test_server_selection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ def test_selector_called(self):
130130
test_collection = mongo_client.testdb.test_collection
131131
self.addCleanup(mongo_client.drop_database, "testdb")
132132

133-
# Do N operations and test selector is called at least N times.
133+
# Do N operations and test selector is called at least N-1 times due to fast path.
134134
test_collection.insert_one({"age": 20, "name": "John"})
135135
test_collection.insert_one({"age": 31, "name": "Jane"})
136136
test_collection.update_one({"name": "Jane"}, {"$set": {"age": 21}})
137137
test_collection.find_one({"name": "Roe"})
138-
self.assertGreaterEqual(selector.call_count, 4)
138+
self.assertGreaterEqual(selector.call_count, 3)
139139

140140
@client_context.require_replica_set
141141
def test_latency_threshold_application(self):

0 commit comments

Comments
 (0)