3232import warnings
3333from test .asynchronous import AsyncIntegrationTest , AsyncPyMongoTestCase , async_client_context
3434from test .asynchronous .test_bulk import AsyncBulkTestBase
35+ from test .asynchronous .utils import flaky
3536from test .asynchronous .utils_spec_runner import AsyncSpecRunner , AsyncSpecTestCreator
3637from threading import Thread
3738from typing import Any , Dict , Mapping , Optional
@@ -3247,6 +3248,7 @@ async def test_kms_retry(self):
32473248class TestAutomaticDecryptionKeys (AsyncEncryptionIntegrationTest ):
32483249 @async_client_context .require_no_standalone
32493250 @async_client_context .require_version_min (7 , 0 , - 1 )
3251+ @flaky (reason = "PYTHON-4982" )
32503252 async def asyncSetUp (self ):
32513253 await super ().asyncSetUp ()
32523254 self .key1_document = json_data ("etc" , "data" , "keys" , "key1-document.json" )
@@ -3489,6 +3491,8 @@ async def test_implicit_session_ignored_when_unsupported(self):
34893491
34903492 self .assertNotIn ("lsid" , self .listener .started_events [1 ].command )
34913493
3494+ await self .mongocryptd_client .close ()
3495+
34923496 async def test_explicit_session_errors_when_unsupported (self ):
34933497 self .listener .reset ()
34943498 async with self .mongocryptd_client .start_session () as s :
@@ -3501,6 +3505,8 @@ async def test_explicit_session_errors_when_unsupported(self):
35013505 ):
35023506 await self .mongocryptd_client .db .test .insert_one ({"x" : 1 }, session = s )
35033507
3508+ await self .mongocryptd_client .close ()
3509+
35043510
35053511if __name__ == "__main__" :
35063512 unittest .main ()
0 commit comments