PYTHON-3577 Fix test_session_gc on serverless (#1153)
This commit is contained in:
parent
6ed6c374f1
commit
1797785f99
@ -122,8 +122,10 @@ class TestLB(IntegrationTest):
|
||||
session = client.start_session()
|
||||
session.start_transaction()
|
||||
client.test_session_gc.test.find_one({}, session=session)
|
||||
# Cleanup the transaction left open on the server.
|
||||
self.addCleanup(self.client.admin.command, "killSessions", [session.session_id])
|
||||
# Cleanup the transaction left open on the server unless we're
|
||||
# testing serverless which does not support killSessions.
|
||||
if not client_context.serverless:
|
||||
self.addCleanup(self.client.admin.command, "killSessions", [session.session_id])
|
||||
if client_context.load_balancer:
|
||||
self.assertEqual(pool.active_sockets, 1) # Pinned.
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user