Skip to content

Commit b4e42a7

Browse files
author
A. Jesse Jiryu Davis
committed
Precisely enforce max_pool_size: unittest
1 parent 9dc6d92 commit b4e42a7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

test/test_pooling.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -652,12 +652,9 @@ def _test_max_pool_size(self, c, start_request, end_request):
652652
cx_pool = c._Connection__pool
653653
force_reclaim_sockets(cx_pool, 4)
654654

655-
# There's a race condition, so be lenient
656655
nsock = len(cx_pool.sockets)
657-
self.assertTrue(
658-
abs(4 - nsock) < 4,
659-
"Expected about 4 sockets in the pool, got %d" % nsock
660-
)
656+
self.assertEqual(4, nsock,
657+
"Expected about 4 sockets in the pool, got %d" % nsock)
661658

662659
def test_max_pool_size(self):
663660
c = get_connection(max_pool_size=4, auto_start_request=False)

0 commit comments

Comments
 (0)