Skip to content

Commit ff9aaf4

Browse files
committed
PYTHON-2761 Don't return a pinned connection to the pool multiple times (#645)
(cherry picked from commit 07146ce)
1 parent 9d75726 commit ff9aaf4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/test_load_balancer.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@
3232

3333

3434
class TestLB(IntegrationTest):
35+
36+
def test_connections_are_only_returned_once(self):
37+
pool = get_pool(self.client)
38+
nconns = len(pool.sockets)
39+
self.db.test.find_one({})
40+
self.assertEqual(len(pool.sockets), nconns)
41+
self.db.test.aggregate([{'$limit': 1}])
42+
self.assertEqual(len(pool.sockets), nconns)
43+
3544
@client_context.require_load_balancer
3645
def test_unpin_committed_transaction(self):
3746
pool = get_pool(self.client)

0 commit comments

Comments
 (0)