We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e91d398 commit b95baf2Copy full SHA for b95baf2
test/test_pooling.py
@@ -396,6 +396,14 @@ def find_one():
396
397
self.assertEqual(len(docs), 50)
398
self.assertLessEqual(len(pool.sockets), 50)
399
+ # TLS and auth make connection establishment more expensive than
400
+ # the artificially delayed query which leads to more threads
401
+ # hitting maxConnecting. The end result is fewer total connections
402
+ # and better latency.
403
+ if client_context.tls and client_context.auth_enabled:
404
+ self.assertLessEqual(len(pool.sockets), 20)
405
+ else:
406
+ self.assertLessEqual(len(pool.sockets), 50)
407
# MongoDB 4.4.1 with auth + ssl:
408
# maxConnecting = 2: 6 connections in ~0.231+ seconds
409
# maxConnecting = unbounded: 50 connections in ~0.642+ seconds
0 commit comments