File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed
test_asyncio/test_multidb Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,12 @@ async def test_execute_command_auto_fallback_to_highest_weight_db(
204204 True ,
205205 True ,
206206 True ,
207+ True ,
208+ True ,
209+ True ,
210+ True ,
211+ True ,
212+ True ,
207213 ]
208214
209215 with (
@@ -218,14 +224,14 @@ async def test_execute_command_auto_fallback_to_highest_weight_db(
218224 mock_db1 .client .execute_command .return_value = "OK1"
219225 mock_db2 .client .execute_command .return_value = "OK2"
220226 mock_multi_db_config .health_check_interval = 0.1
221- mock_multi_db_config .auto_fallback_interval = 0.2
227+ mock_multi_db_config .auto_fallback_interval = 0.5
222228 mock_multi_db_config .failover_strategy = WeightBasedFailoverStrategy ()
223229
224230 client = MultiDBClient (mock_multi_db_config )
225231 assert await client .set ("key" , "value" ) == "OK1"
226- await asyncio .sleep (0.13 )
232+ await asyncio .sleep (0.15 )
227233 assert await client .set ("key" , "value" ) == "OK2"
228- await asyncio .sleep (0.22 )
234+ await asyncio .sleep (0.5 )
229235 assert await client .set ("key" , "value" ) == "OK1"
230236
231237 @pytest .mark .asyncio
Original file line number Diff line number Diff line change @@ -200,6 +200,12 @@ def test_execute_command_auto_fallback_to_highest_weight_db(
200200 True ,
201201 True ,
202202 True ,
203+ True ,
204+ True ,
205+ True ,
206+ True ,
207+ True ,
208+ True ,
203209 ]
204210
205211 with (
@@ -214,14 +220,14 @@ def test_execute_command_auto_fallback_to_highest_weight_db(
214220 mock_db1 .client .execute_command .return_value = "OK1"
215221 mock_db2 .client .execute_command .return_value = "OK2"
216222 mock_multi_db_config .health_check_interval = 0.1
217- mock_multi_db_config .auto_fallback_interval = 0.2
223+ mock_multi_db_config .auto_fallback_interval = 0.5
218224 mock_multi_db_config .failover_strategy = WeightBasedFailoverStrategy ()
219225
220226 client = MultiDBClient (mock_multi_db_config )
221227 assert client .set ("key" , "value" ) == "OK1"
222- sleep (0.13 )
228+ sleep (0.15 )
223229 assert client .set ("key" , "value" ) == "OK2"
224- sleep (0.22 )
230+ sleep (0.5 )
225231 assert client .set ("key" , "value" ) == "OK1"
226232
227233 @pytest .mark .parametrize (
You can’t perform that action at this time.
0 commit comments