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(
204
204
True ,
205
205
True ,
206
206
True ,
207
+ True ,
208
+ True ,
209
+ True ,
210
+ True ,
211
+ True ,
212
+ True ,
207
213
]
208
214
209
215
with (
@@ -218,14 +224,14 @@ async def test_execute_command_auto_fallback_to_highest_weight_db(
218
224
mock_db1 .client .execute_command .return_value = "OK1"
219
225
mock_db2 .client .execute_command .return_value = "OK2"
220
226
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
222
228
mock_multi_db_config .failover_strategy = WeightBasedFailoverStrategy ()
223
229
224
230
client = MultiDBClient (mock_multi_db_config )
225
231
assert await client .set ("key" , "value" ) == "OK1"
226
- await asyncio .sleep (0.13 )
232
+ await asyncio .sleep (0.15 )
227
233
assert await client .set ("key" , "value" ) == "OK2"
228
- await asyncio .sleep (0.22 )
234
+ await asyncio .sleep (0.5 )
229
235
assert await client .set ("key" , "value" ) == "OK1"
230
236
231
237
@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(
200
200
True ,
201
201
True ,
202
202
True ,
203
+ True ,
204
+ True ,
205
+ True ,
206
+ True ,
207
+ True ,
208
+ True ,
203
209
]
204
210
205
211
with (
@@ -214,14 +220,14 @@ def test_execute_command_auto_fallback_to_highest_weight_db(
214
220
mock_db1 .client .execute_command .return_value = "OK1"
215
221
mock_db2 .client .execute_command .return_value = "OK2"
216
222
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
218
224
mock_multi_db_config .failover_strategy = WeightBasedFailoverStrategy ()
219
225
220
226
client = MultiDBClient (mock_multi_db_config )
221
227
assert client .set ("key" , "value" ) == "OK1"
222
- sleep (0.13 )
228
+ sleep (0.15 )
223
229
assert client .set ("key" , "value" ) == "OK2"
224
- sleep (0.22 )
230
+ sleep (0.5 )
225
231
assert client .set ("key" , "value" ) == "OK1"
226
232
227
233
@pytest .mark .parametrize (
You can’t perform that action at this time.
0 commit comments