@@ -3000,14 +3000,6 @@ Y_UNIT_TEST_SUITE(THiveTest) {
3000
3000
3001
3001
// Incorrect test, muted
3002
3002
Y_UNIT_TEST (TestReassignUseRelativeSpace) {
3003
- // TODO: Remove this code after issue https://github.com/ydb-platform/ydb/issues/12255 will be resolved
3004
- ui64 prevSeed = NActors::DefaultRandomSeed;
3005
- NActors::DefaultRandomSeed = 42 ;
3006
- Y_SCOPE_EXIT (prevSeed) {
3007
- NActors::DefaultRandomSeed = prevSeed;
3008
- };
3009
- // TODO: Remove this code after issue https://github.com/ydb-platform/ydb/issues/12255 will be resolved
3010
-
3011
3003
TTestBasicRuntime runtime (1 , false );
3012
3004
Setup (runtime, true , 5 );
3013
3005
const ui64 hiveTablet = MakeDefaultHiveID ();
@@ -3020,7 +3012,7 @@ Y_UNIT_TEST_SUITE(THiveTest) {
3020
3012
MakeSureTabletIsUp (runtime, tabletId, 0 );
3021
3013
3022
3014
TActorId sender = runtime.AllocateEdgeActor ();
3023
- std::unordered_set<ui32> otherPoolGroops ;
3015
+ std::unordered_set<ui32> unusedGroups ;
3024
3016
auto getGroup = [&runtime, sender, hiveTablet](ui64 tabletId) {
3025
3017
runtime.SendToPipe (hiveTablet, sender, new TEvHive::TEvRequestHiveInfo ({
3026
3018
.TabletId = tabletId,
@@ -3039,31 +3031,28 @@ Y_UNIT_TEST_SUITE(THiveTest) {
3039
3031
THolder<TEvBlobStorage::TEvControllerSelectGroups> selectGroups = MakeHolder<TEvBlobStorage::TEvControllerSelectGroups>();
3040
3032
NKikimrBlobStorage::TEvControllerSelectGroups& record = selectGroups->Record ;
3041
3033
record.SetReturnAllMatchingGroups (true );
3042
- std::vector<TString> storagePools = {" def2" , " def3" }; // we will work with pool def1, so we want to avoid messing with other pools
3043
- for (const auto & pool : storagePools) {
3044
- record.AddGroupParameters ()->MutableStoragePoolSpecifier ()->SetName (pool);
3045
- }
3034
+ record.AddGroupParameters ()->MutableStoragePoolSpecifier ()->SetName (" def1" );
3046
3035
runtime.SendToPipe (MakeBSControllerID (), sender, selectGroups.Release ());
3047
3036
TAutoPtr<IEventHandle> handle;
3048
3037
TEvBlobStorage::TEvControllerSelectGroupsResult* response = runtime.GrabEdgeEventRethrow <TEvBlobStorage::TEvControllerSelectGroupsResult>(handle);
3049
3038
for (const auto & matchingGroups : response->Record .GetMatchingGroups ()) {
3050
3039
for (const auto & group : matchingGroups.GetGroups ()) {
3051
- otherPoolGroops .insert (group.GetGroupID ());
3040
+ unusedGroups .insert (group.GetGroupID ());
3052
3041
}
3053
3042
}
3054
3043
}
3055
3044
3056
- auto getFreshGroup = [&otherPoolGroops](ui32 start) {
3057
- for (ui32 groupId = start + 1 ;; ++groupId) {
3058
- if (!otherPoolGroops.contains (groupId)) {
3059
- return groupId;
3060
- }
3061
- }
3045
+ auto getFreshGroup = [&unusedGroups]() {
3046
+ UNIT_ASSERT (!unusedGroups.empty ());
3047
+ ui32 group = *unusedGroups.begin ();
3048
+ unusedGroups.erase (unusedGroups.begin ());
3049
+ return group;
3062
3050
};
3063
3051
3064
3052
ui32 initialGroup = getGroup (tabletId);
3065
- ui32 badGroup = getFreshGroup (initialGroup);
3066
- ui32 goodGroup = getFreshGroup (badGroup);
3053
+ unusedGroups.erase (initialGroup);
3054
+ ui32 badGroup = getFreshGroup ();
3055
+ ui32 goodGroup = getFreshGroup ();
3067
3056
Ctest << " Tablet is now in group " << initialGroup << " , should later move to " << goodGroup << Endl;
3068
3057
3069
3058
struct TTestGroupInfo {
0 commit comments