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 @@ -1847,20 +1847,20 @@ def server_description_count():
1847
1847
return i
1848
1848
1849
1849
gc .collect ()
1850
- with client_knobs (min_heartbeat_interval = 0.003 ):
1850
+ with client_knobs (min_heartbeat_interval = 0.002 ):
1851
1851
client = self .simple_client (
1852
- "invalid:27017" , heartbeatFrequencyMS = 3 , serverSelectionTimeoutMS = 150
1852
+ "invalid:27017" , heartbeatFrequencyMS = 2 , serverSelectionTimeoutMS = 200
1853
1853
)
1854
1854
initial_count = server_description_count ()
1855
1855
with self .assertRaises (ServerSelectionTimeoutError ):
1856
1856
await client .test .test .find_one ()
1857
1857
gc .collect ()
1858
1858
final_count = server_description_count ()
1859
+ await client .close ()
1859
1860
# If a bug like PYTHON-2433 is reintroduced then too many
1860
1861
# ServerDescriptions will be kept alive and this test will fail:
1861
- # AssertionError: 19 != 46 within 15 delta (27 difference)
1862
- # On Python 3.11 we seem to get more of a delta.
1863
- self .assertAlmostEqual (initial_count , final_count , delta = 20 )
1862
+ # AssertionError: 11 != 47 within 20 delta (36 difference)
1863
+ self .assertAlmostEqual (initial_count , final_count , delta = 30 )
1864
1864
1865
1865
@async_client_context .require_failCommand_fail_point
1866
1866
async def test_network_error_message (self ):
Original file line number Diff line number Diff line change @@ -1804,20 +1804,20 @@ def server_description_count():
1804
1804
return i
1805
1805
1806
1806
gc .collect ()
1807
- with client_knobs (min_heartbeat_interval = 0.003 ):
1807
+ with client_knobs (min_heartbeat_interval = 0.002 ):
1808
1808
client = self .simple_client (
1809
- "invalid:27017" , heartbeatFrequencyMS = 3 , serverSelectionTimeoutMS = 150
1809
+ "invalid:27017" , heartbeatFrequencyMS = 2 , serverSelectionTimeoutMS = 200
1810
1810
)
1811
1811
initial_count = server_description_count ()
1812
1812
with self .assertRaises (ServerSelectionTimeoutError ):
1813
1813
client .test .test .find_one ()
1814
1814
gc .collect ()
1815
1815
final_count = server_description_count ()
1816
+ client .close ()
1816
1817
# If a bug like PYTHON-2433 is reintroduced then too many
1817
1818
# ServerDescriptions will be kept alive and this test will fail:
1818
- # AssertionError: 19 != 46 within 15 delta (27 difference)
1819
- # On Python 3.11 we seem to get more of a delta.
1820
- self .assertAlmostEqual (initial_count , final_count , delta = 20 )
1819
+ # AssertionError: 11 != 47 within 20 delta (36 difference)
1820
+ self .assertAlmostEqual (initial_count , final_count , delta = 30 )
1821
1821
1822
1822
@client_context .require_failCommand_fail_point
1823
1823
def test_network_error_message (self ):
You can’t perform that action at this time.
0 commit comments