PYTHON-3577 Fix test_aggregate_out on 4.0 replica set (#1146)

This commit is contained in:
Shane Harvey 2023-01-31 15:22:28 -08:00 committed by GitHub
parent b492263826
commit 540562a606
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -122,6 +122,8 @@ 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])
if client_context.load_balancer:
self.assertEqual(pool.active_sockets, 1) # Pinned.

View File

@ -20,7 +20,7 @@ import unittest
sys.path[0:0] = [""]
from test import IntegrationTest, client_context
from test.utils import OvertCommandListener, rs_or_single_client, single_client
from test.utils import OvertCommandListener, rs_or_single_client
from bson.son import SON
from pymongo.errors import OperationFailure
@ -35,7 +35,7 @@ class TestReadConcern(IntegrationTest):
def setUpClass(cls):
super(TestReadConcern, cls).setUpClass()
cls.listener = OvertCommandListener()
cls.client = single_client(event_listeners=[cls.listener])
cls.client = rs_or_single_client(event_listeners=[cls.listener])
cls.db = cls.client.pymongo_test
client_context.client.pymongo_test.create_collection("coll")