Commit 43e0bb8 1 parent df7304d commit 43e0bb8 Copy full SHA for 43e0bb8
File tree 2 files changed +10
-10
lines changed
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():
1824
1824
return i
1825
1825
1826
1826
gc .collect ()
1827
- with client_knobs (min_heartbeat_interval = 0.003 ):
1827
+ with client_knobs (min_heartbeat_interval = 0.002 ):
1828
1828
client = self .simple_client (
1829
- "invalid:27017" , heartbeatFrequencyMS = 3 , serverSelectionTimeoutMS = 150
1829
+ "invalid:27017" , heartbeatFrequencyMS = 2 , serverSelectionTimeoutMS = 200
1830
1830
)
1831
1831
initial_count = server_description_count ()
1832
1832
with self .assertRaises (ServerSelectionTimeoutError ):
1833
1833
await client .test .test .find_one ()
1834
1834
gc .collect ()
1835
1835
final_count = server_description_count ()
1836
+ await client .close ()
1836
1837
# If a bug like PYTHON-2433 is reintroduced then too many
1837
1838
# 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 )
1841
1841
1842
1842
@async_client_context .require_failCommand_fail_point
1843
1843
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():
1781
1781
return i
1782
1782
1783
1783
gc .collect ()
1784
- with client_knobs (min_heartbeat_interval = 0.003 ):
1784
+ with client_knobs (min_heartbeat_interval = 0.002 ):
1785
1785
client = self .simple_client (
1786
- "invalid:27017" , heartbeatFrequencyMS = 3 , serverSelectionTimeoutMS = 150
1786
+ "invalid:27017" , heartbeatFrequencyMS = 2 , serverSelectionTimeoutMS = 200
1787
1787
)
1788
1788
initial_count = server_description_count ()
1789
1789
with self .assertRaises (ServerSelectionTimeoutError ):
1790
1790
client .test .test .find_one ()
1791
1791
gc .collect ()
1792
1792
final_count = server_description_count ()
1793
+ client .close ()
1793
1794
# If a bug like PYTHON-2433 is reintroduced then too many
1794
1795
# 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 )
1798
1798
1799
1799
@client_context .require_failCommand_fail_point
1800
1800
def test_network_error_message (self ):
You can’t perform that action at this time.
0 commit comments