File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -1824,20 +1824,20 @@ def server_description_count():
18241824 return i
18251825
18261826 gc .collect ()
1827- with client_knobs (min_heartbeat_interval = 0.003 ):
1827+ with client_knobs (min_heartbeat_interval = 0.002 ):
18281828 client = self .simple_client (
1829- "invalid:27017" , heartbeatFrequencyMS = 3 , serverSelectionTimeoutMS = 150
1829+ "invalid:27017" , heartbeatFrequencyMS = 2 , serverSelectionTimeoutMS = 200
18301830 )
18311831 initial_count = server_description_count ()
18321832 with self .assertRaises (ServerSelectionTimeoutError ):
18331833 await client .test .test .find_one ()
18341834 gc .collect ()
18351835 final_count = server_description_count ()
1836+ await client .close ()
18361837 # If a bug like PYTHON-2433 is reintroduced then too many
18371838 # ServerDescriptions will be kept alive and this test will fail:
1838- # AssertionError: 19 != 46 within 15 delta (27 difference)
1839- # On Python 3.11 we seem to get more of a delta.
1840- self .assertAlmostEqual (initial_count , final_count , delta = 20 )
1839+ # AssertionError: 11 != 47 within 20 delta (36 difference)
1840+ self .assertAlmostEqual (initial_count , final_count , delta = 30 )
18411841
18421842 @async_client_context .require_failCommand_fail_point
18431843 async def test_network_error_message (self ):
Original file line number Diff line number Diff line change @@ -1781,20 +1781,20 @@ def server_description_count():
17811781 return i
17821782
17831783 gc .collect ()
1784- with client_knobs (min_heartbeat_interval = 0.003 ):
1784+ with client_knobs (min_heartbeat_interval = 0.002 ):
17851785 client = self .simple_client (
1786- "invalid:27017" , heartbeatFrequencyMS = 3 , serverSelectionTimeoutMS = 150
1786+ "invalid:27017" , heartbeatFrequencyMS = 2 , serverSelectionTimeoutMS = 200
17871787 )
17881788 initial_count = server_description_count ()
17891789 with self .assertRaises (ServerSelectionTimeoutError ):
17901790 client .test .test .find_one ()
17911791 gc .collect ()
17921792 final_count = server_description_count ()
1793+ client .close ()
17931794 # If a bug like PYTHON-2433 is reintroduced then too many
17941795 # ServerDescriptions will be kept alive and this test will fail:
1795- # AssertionError: 19 != 46 within 15 delta (27 difference)
1796- # On Python 3.11 we seem to get more of a delta.
1797- self .assertAlmostEqual (initial_count , final_count , delta = 20 )
1796+ # AssertionError: 11 != 47 within 20 delta (36 difference)
1797+ self .assertAlmostEqual (initial_count , final_count , delta = 30 )
17981798
17991799 @client_context .require_failCommand_fail_point
18001800 def test_network_error_message (self ):
You can’t perform that action at this time.
0 commit comments