@@ -1054,7 +1054,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
1054
1054
void Bootstrap () {
1055
1055
Become (&TThis::StateDefault);
1056
1056
}
1057
-
1057
+
1058
1058
STATEFN (StateDefault) {
1059
1059
switch (ev->GetTypeRewrite ()) {
1060
1060
case TEvBlobStorage::TEvControllerUpdateDiskStatus::EventType: {
@@ -1069,7 +1069,8 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
1069
1069
1070
1070
testCtx.Send (new TEvents::TEvWakeup ());
1071
1071
1072
- testCtx.GetRuntime ()->RegisterService (MakeBlobStorageNodeWardenID (1 ), nodeWardenFake);
1072
+ const ui32 firstNodeId = testCtx.GetRuntime ()->GetFirstNodeId ();
1073
+ testCtx.GetRuntime ()->RegisterService (MakeBlobStorageNodeWardenID (firstNodeId), nodeWardenFake);
1073
1074
1074
1075
testCtx.GetRuntime ()->WaitFor (" TEvControllerUpdateDiskStatus" , [&received]() {
1075
1076
return received;
@@ -1119,7 +1120,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
1119
1120
for (int num_inspect=10 ; num_inspect>0 ; --num_inspect) {
1120
1121
const auto evPDiskStateUpdate = testCtx.Recv <NNodeWhiteboard::TEvWhiteboard::TEvPDiskStateUpdate>();
1121
1122
NKikimrWhiteboard::TPDiskStateInfo pdiskInfo = evPDiskStateUpdate.Get ()->Record ;
1122
- Cerr << (TStringBuilder () << " - Got EvPDiskStateUpdate# " << evPDiskStateUpdate->ToString () << Endl);
1123
+ Cerr << (TStringBuilder () << " Got EvPDiskStateUpdate# " << evPDiskStateUpdate->ToString () << Endl);
1123
1124
if (!pdiskInfo.HasSlotSizeInUnits ()) {
1124
1125
continue ;
1125
1126
}
@@ -1132,15 +1133,12 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
1132
1133
};
1133
1134
1134
1135
Y_UNIT_TEST (PDiskSlotSizeInUnits) {
1135
- TActorTestContext testCtx ({
1136
- .IsBad =false ,
1137
- .DiskSize = 1_GB,
1138
- .ChunkSize = 1_MB,
1139
- });
1136
+ TActorTestContext testCtx ({});
1137
+ const ui32 firstNodeId = testCtx.GetRuntime ()->GetFirstNodeId ();
1140
1138
1141
1139
// Setup receiving whiteboard state updates
1142
1140
testCtx.GetRuntime ()->SetDispatchTimeout (10 * TDuration::MilliSeconds (testCtx.GetPDiskConfig ()->StatisticsUpdateIntervalMs ));
1143
- testCtx.GetRuntime ()->RegisterService (NNodeWhiteboard::MakeNodeWhiteboardServiceId (1 ), testCtx.Sender );
1141
+ testCtx.GetRuntime ()->RegisterService (NNodeWhiteboard::MakeNodeWhiteboardServiceId (firstNodeId ), testCtx.Sender );
1144
1142
AwaitAndCheckEvPDiskStateUpdate (testCtx, 0u , 0 );
1145
1143
1146
1144
// Setup 2 vdisks
@@ -1156,9 +1154,10 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
1156
1154
vdisk1.CommitReservedChunks ();
1157
1155
vdisk2.CommitReservedChunks ();
1158
1156
1159
- // State:
1157
+ // State 1 :
1160
1158
// PDisk.SlotSizeUnits: 0
1161
1159
// Owners.GroupSizeInUnits: [0, 4]
1160
+ Cerr << (TStringBuilder () << " - State 1" << Endl);
1162
1161
1163
1162
// Assert NumActiveSlots == 5
1164
1163
const auto evCheckSpaceResponse1 = testCtx.TestResponse <NPDisk::TEvCheckSpaceResult>(
@@ -1198,9 +1197,10 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
1198
1197
new NPDisk::TEvYardResize (vdisk1.PDiskParams ->Owner , vdisk1.PDiskParams ->OwnerRound , 2u ),
1199
1198
NKikimrProto::OK);
1200
1199
1201
- // State:
1200
+ // State 2 :
1202
1201
// PDisk.SlotSizeUnits: 0
1203
1202
// Owners.GroupSizeInUnits: [2, 4]
1203
+ Cerr << (TStringBuilder () << " - State 2" << Endl);
1204
1204
1205
1205
// Assert NumActiveSlots == 6
1206
1206
const auto evCheckSpaceResponse3 = testCtx.TestResponse <NPDisk::TEvCheckSpaceResult>(
@@ -1216,9 +1216,10 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
1216
1216
TVDiskMock vdisk3 (&testCtx);
1217
1217
vdisk3.InitFull (2u );
1218
1218
1219
- // State:
1219
+ // State 3 :
1220
1220
// PDisk.SlotSizeUnits: 2
1221
1221
// Owners.GroupSizeInUnits: [2, 4, 2]
1222
+ Cerr << (TStringBuilder () << " - State 3" << Endl);
1222
1223
1223
1224
// Assert NumActiveSlots == 4
1224
1225
const auto evCheckSpaceResponse4 = testCtx.TestResponse <NPDisk::TEvCheckSpaceResult>(
@@ -1644,7 +1645,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
1644
1645
using namespace NPriRead ;
1645
1646
std::vector<ui8> PriRead = {SyncLog, HullComp, HullOnlineRt, HullOnlineOther, HullLoad, HullLow};
1646
1647
auto shares = GetChunkOperationPriorities (true , PriRead);
1647
-
1648
+
1648
1649
// compare with 10% tolerance
1649
1650
UNIT_ASSERT (shares[SyncLog] * 0.90 > shares[HullLoad]);
1650
1651
UNIT_ASSERT (shares[HullLoad] * 0.90 > shares[HullOnlineRt]);
@@ -1659,7 +1660,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
1659
1660
using namespace NPriWrite ;
1660
1661
std::vector<ui8> PriWrite = {SyncLog, HullFresh, HullHugeAsyncBlob, HullHugeUserData, HullComp};
1661
1662
auto shares = GetChunkOperationPriorities (false , PriWrite);
1662
-
1663
+
1663
1664
// compare with 10% tolerance
1664
1665
UNIT_ASSERT (shares[SyncLog] * 0.90 > shares[HullHugeUserData]);
1665
1666
UNIT_ASSERT (shares[HullHugeUserData] * 0.90 > shares[HullComp]);
0 commit comments