@@ -1581,6 +1581,27 @@ Y_UNIT_TEST_SUITE(THiveTest) {
15811581 runtime.SetObserverFunc (prevObserverFunc);
15821582 }
15831583
1584+ Y_UNIT_TEST (TestNoMigrationToSelf) {
1585+ TTestBasicRuntime runtime (2 , false );
1586+ Setup (runtime, true );
1587+
1588+ const ui64 hiveTablet = MakeDefaultHiveID ();
1589+ const ui64 testerTablet = MakeTabletID (false , 1 );
1590+ TActorId sender = runtime.AllocateEdgeActor (0 );
1591+ CreateTestBootstrapper (runtime, CreateTestTabletInfo (hiveTablet, TTabletTypes::Hive), &CreateDefaultHive);
1592+ MakeSureTabletIsUp (runtime, hiveTablet, 0 );
1593+
1594+ THolder<TEvHive::TEvCreateTablet> createTablet = MakeHolder<TEvHive::TEvCreateTablet>(testerTablet, 1 , TTabletTypes::Dummy, BINDED_CHANNELS);
1595+ SendCreateTestTablet (runtime, hiveTablet, testerTablet, std::move (createTablet), 0 , true );
1596+
1597+ THolder<TEvHive::TEvInitMigration> migration = MakeHolder<TEvHive::TEvInitMigration>();
1598+ runtime.SendToPipe (hiveTablet, sender, migration.Release (), 0 , GetPipeConfigWithRetries ());
1599+ TAutoPtr<IEventHandle> handle;
1600+ auto initMigrationReply = runtime.GrabEdgeEventRethrow <TEvHive::TEvInitMigrationReply>(handle);
1601+ UNIT_ASSERT (initMigrationReply);
1602+ UNIT_ASSERT (initMigrationReply->Record .GetStatus () == NKikimrProto::ERROR);
1603+ }
1604+
15841605 Y_UNIT_TEST (TestCheckSubHiveMigrationManyTablets) {
15851606 TTestBasicRuntime runtime (2 , false );
15861607 Setup (runtime, true );
0 commit comments