32
32
import warnings
33
33
from test .asynchronous import AsyncIntegrationTest , AsyncPyMongoTestCase , async_client_context
34
34
from test .asynchronous .test_bulk import AsyncBulkTestBase
35
+ from test .asynchronous .utils import flaky
35
36
from test .asynchronous .utils_spec_runner import AsyncSpecRunner , AsyncSpecTestCreator
36
37
from threading import Thread
37
38
from typing import Any , Dict , Mapping , Optional
@@ -3247,6 +3248,7 @@ async def test_kms_retry(self):
3247
3248
class TestAutomaticDecryptionKeys (AsyncEncryptionIntegrationTest ):
3248
3249
@async_client_context .require_no_standalone
3249
3250
@async_client_context .require_version_min (7 , 0 , - 1 )
3251
+ @flaky (reason = "PYTHON-4982" )
3250
3252
async def asyncSetUp (self ):
3251
3253
await super ().asyncSetUp ()
3252
3254
self .key1_document = json_data ("etc" , "data" , "keys" , "key1-document.json" )
@@ -3489,6 +3491,8 @@ async def test_implicit_session_ignored_when_unsupported(self):
3489
3491
3490
3492
self .assertNotIn ("lsid" , self .listener .started_events [1 ].command )
3491
3493
3494
+ await self .mongocryptd_client .close ()
3495
+
3492
3496
async def test_explicit_session_errors_when_unsupported (self ):
3493
3497
self .listener .reset ()
3494
3498
async with self .mongocryptd_client .start_session () as s :
@@ -3501,6 +3505,8 @@ async def test_explicit_session_errors_when_unsupported(self):
3501
3505
):
3502
3506
await self .mongocryptd_client .db .test .insert_one ({"x" : 1 }, session = s )
3503
3507
3508
+ await self .mongocryptd_client .close ()
3509
+
3504
3510
3505
3511
if __name__ == "__main__" :
3506
3512
unittest .main ()
0 commit comments