Skip to content

Commit c9ffb77

Browse files
authored
Fix and unmute PDisk tests (merge from main #25696) (#25720)
2 parents 1003e69 + dcdaf0d commit c9ffb77

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

.github/config/muted_ya.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
ydb/core/blobstorage/dsproxy/ut_fat TBlobStorageProxyTest.TestBatchedPutRequestDoesNotContainAHugeBlob
22
ydb/core/blobstorage/pdisk/ut TPDiskTest.AllRequestsAreAnsweredOnPDiskRestart
3-
ydb/core/blobstorage/pdisk/ut TPDiskTest.FailedToFormatDiskInfoUpdate
4-
ydb/core/blobstorage/pdisk/ut TPDiskTest.PDiskSlotSizeInUnits
53
ydb/core/blobstorage/pdisk/ut TPDiskTest.TestStartEncryptedOrPlainAndRestart
64
ydb/core/blobstorage/ut_blobstorage BlobPatching.PatchBlock42
75
ydb/core/blobstorage/ut_blobstorage Defragmentation.CorruptedReadHandling

ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
10541054
void Bootstrap() {
10551055
Become(&TThis::StateDefault);
10561056
}
1057-
1057+
10581058
STATEFN(StateDefault) {
10591059
switch (ev->GetTypeRewrite()) {
10601060
case TEvBlobStorage::TEvControllerUpdateDiskStatus::EventType: {
@@ -1069,7 +1069,8 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
10691069

10701070
testCtx.Send(new TEvents::TEvWakeup());
10711071

1072-
testCtx.GetRuntime()->RegisterService(MakeBlobStorageNodeWardenID(1), nodeWardenFake);
1072+
const ui32 firstNodeId = testCtx.GetRuntime()->GetFirstNodeId();
1073+
testCtx.GetRuntime()->RegisterService(MakeBlobStorageNodeWardenID(firstNodeId), nodeWardenFake);
10731074

10741075
testCtx.GetRuntime()->WaitFor("TEvControllerUpdateDiskStatus", [&received]() {
10751076
return received;
@@ -1119,7 +1120,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
11191120
for (int num_inspect=10; num_inspect>0; --num_inspect) {
11201121
const auto evPDiskStateUpdate = testCtx.Recv<NNodeWhiteboard::TEvWhiteboard::TEvPDiskStateUpdate>();
11211122
NKikimrWhiteboard::TPDiskStateInfo pdiskInfo = evPDiskStateUpdate.Get()->Record;
1122-
Cerr << (TStringBuilder() << "- Got EvPDiskStateUpdate# " << evPDiskStateUpdate->ToString() << Endl);
1123+
Cerr << (TStringBuilder() << "Got EvPDiskStateUpdate# " << evPDiskStateUpdate->ToString() << Endl);
11231124
if (!pdiskInfo.HasSlotSizeInUnits()) {
11241125
continue;
11251126
}
@@ -1132,15 +1133,12 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
11321133
};
11331134

11341135
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();
11401138

11411139
// Setup receiving whiteboard state updates
11421140
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);
11441142
AwaitAndCheckEvPDiskStateUpdate(testCtx, 0u, 0);
11451143

11461144
// Setup 2 vdisks
@@ -1156,9 +1154,10 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
11561154
vdisk1.CommitReservedChunks();
11571155
vdisk2.CommitReservedChunks();
11581156

1159-
// State:
1157+
// State 1:
11601158
// PDisk.SlotSizeUnits: 0
11611159
// Owners.GroupSizeInUnits: [0, 4]
1160+
Cerr << (TStringBuilder() << "- State 1" << Endl);
11621161

11631162
// Assert NumActiveSlots == 5
11641163
const auto evCheckSpaceResponse1 = testCtx.TestResponse<NPDisk::TEvCheckSpaceResult>(
@@ -1198,9 +1197,10 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
11981197
new NPDisk::TEvYardResize(vdisk1.PDiskParams->Owner, vdisk1.PDiskParams->OwnerRound, 2u),
11991198
NKikimrProto::OK);
12001199

1201-
// State:
1200+
// State 2:
12021201
// PDisk.SlotSizeUnits: 0
12031202
// Owners.GroupSizeInUnits: [2, 4]
1203+
Cerr << (TStringBuilder() << "- State 2" << Endl);
12041204

12051205
// Assert NumActiveSlots == 6
12061206
const auto evCheckSpaceResponse3 = testCtx.TestResponse<NPDisk::TEvCheckSpaceResult>(
@@ -1216,9 +1216,10 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
12161216
TVDiskMock vdisk3(&testCtx);
12171217
vdisk3.InitFull(2u);
12181218

1219-
// State:
1219+
// State 3:
12201220
// PDisk.SlotSizeUnits: 2
12211221
// Owners.GroupSizeInUnits: [2, 4, 2]
1222+
Cerr << (TStringBuilder() << "- State 3" << Endl);
12221223

12231224
// Assert NumActiveSlots == 4
12241225
const auto evCheckSpaceResponse4 = testCtx.TestResponse<NPDisk::TEvCheckSpaceResult>(
@@ -1644,7 +1645,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
16441645
using namespace NPriRead;
16451646
std::vector<ui8> PriRead = {SyncLog, HullComp, HullOnlineRt, HullOnlineOther, HullLoad, HullLow};
16461647
auto shares = GetChunkOperationPriorities(true, PriRead);
1647-
1648+
16481649
// compare with 10% tolerance
16491650
UNIT_ASSERT(shares[SyncLog] * 0.90 > shares[HullLoad]);
16501651
UNIT_ASSERT(shares[HullLoad] * 0.90 > shares[HullOnlineRt]);
@@ -1659,7 +1660,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) {
16591660
using namespace NPriWrite;
16601661
std::vector<ui8> PriWrite = {SyncLog, HullFresh, HullHugeAsyncBlob, HullHugeUserData, HullComp};
16611662
auto shares = GetChunkOperationPriorities(false, PriWrite);
1662-
1663+
16631664
// compare with 10% tolerance
16641665
UNIT_ASSERT(shares[SyncLog] * 0.90 > shares[HullHugeUserData]);
16651666
UNIT_ASSERT(shares[HullHugeUserData] * 0.90 > shares[HullComp]);

0 commit comments

Comments
 (0)