@@ -1433,11 +1433,15 @@ async def test_migration_with_key_ttl(df_factory):
1433
1433
assert await nodes [1 ].client .execute_command ("stick k_sticky" ) == 0
1434
1434
1435
1435
1436
- @pytest .mark .skip ("test is flaky" )
1437
1436
@dfly_args ({"proactor_threads" : 4 , "cluster_mode" : "yes" })
1438
1437
async def test_network_disconnect_during_migration (df_factory ):
1439
1438
instances = [
1440
- df_factory .create (port = next (next_port ), admin_port = next (next_port )) for i in range (2 )
1439
+ df_factory .create (
1440
+ port = next (next_port ),
1441
+ admin_port = next (next_port ),
1442
+ vmodule = "cluster_family=9,outgoing_slot_migration=9,incoming_slot_migration=9" ,
1443
+ )
1444
+ for i in range (2 )
1441
1445
]
1442
1446
1443
1447
df_factory .start_all (instances )
@@ -1467,21 +1471,24 @@ async def test_network_disconnect_during_migration(df_factory):
1467
1471
logging .debug (
1468
1472
await nodes [0 ].admin_client .execute_command ("DFLYCLUSTER" , "SLOT-MIGRATION-STATUS" )
1469
1473
)
1470
- finally :
1474
+
1471
1475
await wait_for_status (nodes [0 ].admin_client , nodes [1 ].id , "SYNC" )
1476
+ finally :
1472
1477
await proxy .close (task )
1473
1478
1474
1479
await proxy .start ()
1480
+ task = asyncio .create_task (proxy .serve ())
1481
+ try :
1482
+ await wait_for_status (nodes [0 ].admin_client , nodes [1 ].id , "FINISHED" , 300 )
1483
+ nodes [0 ].migrations = []
1484
+ nodes [0 ].slots = []
1485
+ nodes [1 ].slots = [(0 , 16383 )]
1486
+ logging .debug ("remove finished migrations" )
1487
+ await push_config (json .dumps (generate_config (nodes )), [node .admin_client for node in nodes ])
1475
1488
1476
- await wait_for_status (nodes [0 ].admin_client , nodes [1 ].id , "FINISHED" , 300 )
1477
- nodes [0 ].migrations = []
1478
- nodes [0 ].slots = []
1479
- nodes [1 ].slots = [(0 , 16383 )]
1480
- logging .debug ("remove finished migrations" )
1481
- await push_config (json .dumps (generate_config (nodes )), [node .admin_client for node in nodes ])
1482
-
1483
- assert (await StaticSeeder .capture (nodes [1 ].client )) == start_capture
1484
- await proxy .close ()
1489
+ assert (await StaticSeeder .capture (nodes [1 ].client )) == start_capture
1490
+ finally :
1491
+ await proxy .close (task )
1485
1492
1486
1493
1487
1494
@pytest .mark .parametrize (
0 commit comments