diff options
| author | Vlad Kuznetsov <[email protected]> | 2024-10-10 19:46:28 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-10-10 19:46:28 +0200 |
| commit | ebdb387f61ea34793dad2e34243f768c7bbe215a (patch) | |
| tree | 76131aaaae819920566f8dc9f7436a797c5a25ab | |
| parent | 3f2be3e83d67c347ce6ec5deb60e606555151345 (diff) | |
Add basic test for PDisk on file with encryption (#10315)
12 files changed, 212 insertions, 175 deletions
diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice_ut.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice_ut.cpp index 9e9fe3562c2..dd51c32da56 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice_ut.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice_ut.cpp @@ -139,19 +139,6 @@ private: TDuration WorkTime; }; -TString CreateFile(const char *baseDir, ui32 dataSize) { - TString databaseDirectory = MakeDatabasePath(baseDir); - MakeDirIfNotExist(databaseDirectory.c_str()); - TString path = MakePDiskPath(baseDir); - { - TFile file(path.c_str(), OpenAlways | RdWr | Seq | Direct); - file.Resize(dataSize); - file.Close(); - } - UNIT_ASSERT_EQUAL_C(NFs::Exists(path), true, "File " << path << " does not exist."); - return path; -} - void WaitForValue(TAtomic *counter, TDuration maxDuration, TAtomicBase expectedValue) { TInstant finishTime = TInstant::Now() + maxDuration; while (TInstant::Now() < finishTime) { diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_restore_ut.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_restore_ut.cpp index 9b89881e631..d63f4bafe68 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_restore_ut.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_restore_ut.cpp @@ -13,7 +13,7 @@ namespace NKikimr { Y_UNIT_TEST_SUITE(TYardTestRestore) { YARD_UNIT_TEST(TestRestore15) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; Run<TTestWriteChunksAndLog>(&tc, 1, chunkSize, false); // TODO(kruall): fix the test and remove the line below diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp index c2414d71aa7..9d92c5258ae 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp @@ -85,7 +85,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(TestPDiskActorPDiskStopStart) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; const TVDiskID vDiskID(0, 1, 0, 0, 0); testCtx.TestResponse<NPDisk::TEvYardInitResult>( @@ -114,7 +114,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(TestPDiskOwnerRecreation) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; const TVDiskID vDiskID(0, 1, 0, 0, 0); for (ui32 i = 2; i < 2000; ++i) { @@ -129,7 +129,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(TestPDiskOwnerRecreationWithStableOwner) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; // Create "stable" owner, who will be alive during all test ui32 i = 2; @@ -151,7 +151,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(TestPDiskManyOwnersInitiation) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; TVector<TVDiskIDOwnerRound> goodIds; ui64 badIdsCount = 0; @@ -184,22 +184,43 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } } + + // the test is supposed to be fast enough to be used with a lot of different configuration parameters + void BasicTest(TActorTestContext& testCtx, TVDiskMock& mock) { + for (ui32 restarts = 0; restarts < 2; restarts++) { + mock.InitFull(); + const int logsSent = 100; + for (int i = 0; i < logsSent; ++i) { + mock.SendEvLogSync(); + mock.ReserveChunk(); + mock.CommitReservedChunks(); + } + + mock.Init(); // asserts owned chunks + UNIT_ASSERT(mock.ReadLog() == mock.OwnedLogRecords()); + + mock.DeleteCommitedChunks(); + mock.CutLogAllButOne(); + mock.Init(); // asserts log is cut and no chunks owned + testCtx.RestartPDiskSync(); + } + } + Y_UNIT_TEST(TestVDiskMock) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; TVDiskMock mock(&testCtx); + BasicTest(testCtx, mock); + } - mock.InitFull(); - const int logsSent = 100; - for (int i = 0; i < logsSent; ++i) { - mock.SendEvLogSync(); - } + Y_UNIT_TEST(TestRealFile) { + TActorTestContext testCtx({ .UseSectorMap = false }); + TVDiskMock mock(&testCtx); - mock.Init(); - UNIT_ASSERT(mock.ReadLog() == mock.OwnedLogRecords()); + BasicTest(testCtx, mock); } Y_UNIT_TEST(TestLogWriteReadWithRestarts) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; TVDiskMock vdisk(&testCtx); vdisk.InitFull(); @@ -345,7 +366,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(TestFakeErrorPDiskManyLogWrite) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; testCtx.TestCtx.SectorMap->IoErrorEveryNthRequests = 1000; const TVDiskID vDiskID(0, 1, 0, 0, 0); @@ -370,7 +391,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(TestFakeErrorPDiskLogRead) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; TVDiskMock vdisk(&testCtx); vdisk.InitFull(); @@ -398,7 +419,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(TestFakeErrorPDiskSysLogRead) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; TVDiskMock vdisk(&testCtx); vdisk.InitFull(); @@ -416,7 +437,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(TestFakeErrorPDiskManyChunkRead) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; testCtx.TestCtx.SectorMap->ReadIoErrorEveryNthRequests = 100; TVDiskMock vdisk(&testCtx); @@ -455,7 +476,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(TestFakeErrorPDiskManyChunkWrite) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; testCtx.TestCtx.SectorMap->IoErrorEveryNthRequests = 1000; const TVDiskID vDiskID(0, 1, 0, 0, 0); @@ -492,7 +513,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(TestSIGSEGVInTUndelivered) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; const TVDiskID vDiskID(0, 1, 0, 0, 0); const auto evInitRes = testCtx.TestResponse<NPDisk::TEvYardInitResult>( new NPDisk::TEvYardInit(2, vDiskID, testCtx.TestCtx.PDiskGuid), @@ -510,7 +531,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(PDiskRestart) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; TVDiskMock vdisk(&testCtx); vdisk.InitFull(); vdisk.SendEvLogSync(); @@ -522,7 +543,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(PDiskRestartManyLogWrites) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; const TVDiskID vDiskID(0, 1, 0, 0, 0); const auto evInitRes = testCtx.TestResponse<NPDisk::TEvYardInitResult>( @@ -557,7 +578,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(CommitDeleteChunks) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; TVDiskMock intensiveVDisk(&testCtx); intensiveVDisk.InitFull(); intensiveVDisk.ReserveChunk(); @@ -681,7 +702,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { Y_UNIT_TEST(SpaceColor) { return; // Enable test after KIKIMR-12880 - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; TVDiskMock vdisk(&testCtx); using TColor = NKikimrBlobStorage::TPDiskSpaceColor; @@ -717,7 +738,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(DeviceHaltTooLong) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; testCtx.TestCtx.SectorMap->ImitateRandomWait = {TDuration::Seconds(1), TDuration::Seconds(2)}; TVDiskMock mock(&testCtx); @@ -733,7 +754,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(TestPDiskOnDifferentKeys) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; int round = 2; const TVDiskID vDiskID(0, 1, 0, 0, 0); @@ -759,7 +780,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { Y_UNIT_TEST(ChangePDiskKey) { const TString data = PrepareData(4096); - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; TVDiskMock mock(&testCtx); mock.InitFull(); @@ -813,7 +834,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { Y_UNIT_TEST(WrongPDiskKey) { const TString data = PrepareData(4096); - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; TVDiskMock mock(&testCtx); mock.InitFull(); @@ -845,7 +866,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(RecreateWithInvalidPDiskKey) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; int round = 2; const TVDiskID vDiskID(0, 1, 0, 0, 0); @@ -913,7 +934,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { } Y_UNIT_TEST(TestChunkWriteCrossOwner) { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; TVDiskMock vdisk1(&testCtx); TVDiskMock vdisk2(&testCtx); diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_context.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_context.cpp new file mode 100644 index 00000000000..d1eea3556e8 --- /dev/null +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_context.cpp @@ -0,0 +1,17 @@ +#include "blobstorage_pdisk_ut_context.h" +#include "blobstorage_pdisk_ut_helpers.h" + +namespace NKikimr { + +TTestContext::TTestContext(bool useSectorMap, EDiskMode diskMode, ui64 diskSize) { + + if (useSectorMap) { + SectorMap = new NPDisk::TSectorMap(diskSize, diskMode); + } else { + TempDir.Reset(new TTempDir); + Path = CreateFile(GetDir(), diskSize); + Cerr << "Path# " << Path << Endl; + } +} + +} // namespace NKikimr diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_context.h b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_context.h index 538c73b6b50..b772ec66319 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_context.h +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_context.h @@ -11,19 +11,15 @@ namespace NKikimr { class TTestContext { public: ui64 PDiskGuid = 0; - const char* Dir = nullptr; TIntrusivePtr<NPDisk::TSectorMap> SectorMap; THolder<TTempDir> TempDir; + TString Path; using EDiskMode = NPDisk::NSectorMap::EDiskMode; - TTestContext(bool makeTempDir, bool useSectorMap, EDiskMode diskMode = EDiskMode::DM_NONE, ui64 sectorMapSize = 0) { - if (makeTempDir) { - TempDir.Reset(new TTempDir); - Dir = TempDir->Name().c_str(); - } - if (useSectorMap) { - SectorMap = new NPDisk::TSectorMap(sectorMapSize, diskMode); - } + TTestContext(bool useSectorMap, EDiskMode diskMode = EDiskMode::DM_NONE, ui64 diskSize = 0); + + const char *GetDir() { + return TempDir ? TempDir->Name().c_str() : nullptr; } bool IsFormatedDiskExpected() { @@ -32,8 +28,8 @@ public: return true; } } - if (Dir) { - return NFs::Exists(Dir); + if (TempDir) { + return NFs::Exists(TempDir->Name()); } return false; } diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_env.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_env.cpp index 8fe6ce9009b..9c9229a674f 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_env.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_env.cpp @@ -14,7 +14,7 @@ void RecreateOwner(TActorTestContext& testCtx, TVDiskIDOwnerRound& vdisk) { } void TestChunkWriteReleaseRun() { - TActorTestContext testCtx({ false }); + TActorTestContext testCtx{{}}; const TVDiskID vDiskID(0, 1, 0, 0, 0); const auto evInitRes = testCtx.TestResponse<NPDisk::TEvYardInitResult>( diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_env.h b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_env.h index 72569b117c9..ce27e949c5a 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_env.h +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_env.h @@ -19,13 +19,14 @@ struct TActorTestContext { using EDiskMode = NPDisk::NSectorMap::EDiskMode; public: struct TSettings { - bool IsBad; + bool IsBad = false; bool UsePDiskMock = false; ui64 DiskSize = 0; EDiskMode DiskMode = EDiskMode::DM_NONE; ui32 ChunkSize = 128 * (1 << 20); bool SmallDisk = false; bool SuppressCompatibilityCheck = false; + bool UseSectorMap = true; }; private: @@ -41,17 +42,16 @@ public: TSettings Settings; TIntrusivePtr<TPDiskConfig> DefaultPDiskConfig(bool isBad) { - TString path; EntropyPool().Read(&TestCtx.PDiskGuid, sizeof(TestCtx.PDiskGuid)); ui64 formatGuid = TestCtx.PDiskGuid + static_cast<ui64>(isBad); if (Settings.DiskSize) { - FormatPDiskForTest(path, formatGuid, Settings.ChunkSize, Settings.DiskSize, false, TestCtx.SectorMap, Settings.SmallDisk); + FormatPDiskForTest(TestCtx.Path, formatGuid, Settings.ChunkSize, Settings.DiskSize, false, TestCtx.SectorMap, Settings.SmallDisk); } else { - FormatPDiskForTest(path, formatGuid, Settings.ChunkSize, false, TestCtx.SectorMap, Settings.SmallDisk); + FormatPDiskForTest(TestCtx.Path, formatGuid, Settings.ChunkSize, false, TestCtx.SectorMap, Settings.SmallDisk); } ui64 pDiskCategory = 0; - TIntrusivePtr<TPDiskConfig> pDiskConfig = new TPDiskConfig(path, TestCtx.PDiskGuid, 1, pDiskCategory); + TIntrusivePtr<TPDiskConfig> pDiskConfig = new TPDiskConfig(TestCtx.Path, TestCtx.PDiskGuid, 1, pDiskCategory); pDiskConfig->GetDriveDataSwitch = NKikimrBlobStorage::TPDiskConfig::DoNotTouch; pDiskConfig->WriteCacheSwitch = NKikimrBlobStorage::TPDiskConfig::DoNotTouch; pDiskConfig->ChunkSize = Settings.ChunkSize; @@ -64,7 +64,7 @@ public: TActorTestContext(TSettings settings) : Runtime(new TTestActorRuntime(1, true)) - , TestCtx(false, true, settings.DiskMode, settings.DiskSize) + , TestCtx(settings.UseSectorMap, settings.DiskMode, settings.DiskSize) , Settings(settings) { auto appData = MakeHolder<TAppData>(0, 0, 0, 0, TMap<TString, ui32>(), nullptr, nullptr, nullptr, nullptr); @@ -78,7 +78,7 @@ public: Runtime->SetLogPriority(NKikimrServices::BS_PDISK_TEST, NLog::PRI_DEBUG); Sender = Runtime->AllocateEdgeActor(); - TIntrusivePtr<TPDiskConfig> cfg = DefaultPDiskConfig(Settings.IsBad); + auto cfg = DefaultPDiskConfig(Settings.IsBad); UpdateConfigRecreatePDisk(cfg); } @@ -130,7 +130,7 @@ public: } return PDisk; } - + void GracefulPDiskRestart(bool waitForRestart = true) { ui32 pdiskId = GetPDisk()->PCtx->PDiskId; diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.cpp index 1b942e4dc83..5c28cf4bddc 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.cpp @@ -35,7 +35,7 @@ TString StatusToString(const NKikimrProto::EReplyStatus status) { } TString MakeDatabasePath(const char *dir) { - TString databaseDirectory = Sprintf("%s/yard", dir); + TString databaseDirectory = Sprintf("%s/pdisk", dir); return databaseDirectory; } @@ -44,10 +44,23 @@ TString MakePDiskPath(const char *dir) { if (IsRealBlockDevice) { return RealBlockDevicePath; } else { - return databaseDirectory + "/pdisk.dat"; + return databaseDirectory + "/data.bin"; } } +TString CreateFile(const char *baseDir, ui32 dataSize) { + TString databaseDirectory = MakeDatabasePath(baseDir); + MakeDirIfNotExist(databaseDirectory.c_str()); + TString path = MakePDiskPath(baseDir); + { + TFile file(path.c_str(), OpenAlways | RdWr | Seq | Direct); + file.Resize(dataSize); + file.Close(); + } + UNIT_ASSERT_EQUAL_C(NFs::Exists(path), true, "File " << path << " does not exist."); + return path; +} + void FormatPDiskForTest(TString path, ui64 guid, ui32& chunkSize, ui64 diskSize, bool isErasureEncodeUserLog, TIntrusivePtr<NPDisk::TSectorMap> sectorMap, bool enableSmallDiskOptimization) { NPDisk::TKey chunkKey; diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.h b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.h index 94259b12750..91e7be5061b 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.h +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.h @@ -13,6 +13,7 @@ TString PrepareData(ui32 size, ui32 flavor = 0); TString StatusToString(const NKikimrProto::EReplyStatus status); TString MakeDatabasePath(const char *dir); TString MakePDiskPath(const char *dir); +TString CreateFile(const char *baseDir, ui32 dataSize); void FormatPDiskForTest(TString path, ui64 guid, ui32& chunkSize, ui64 diskSize, bool isErasureEncodeUserLog, TIntrusivePtr<NPDisk::TSectorMap> sectorMap, bool enableSmallDiskOptimization = false); void FormatPDiskForTest(TString path, ui64 guid, ui32& chunkSize, bool isErasureEncodeUserLog, diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_run.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_run.cpp index 157cdb0669c..7c3160c63f2 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_run.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_run.cpp @@ -62,9 +62,10 @@ void Run(TVector<IActor*> tests, TTestRunConfig runCfg) { TString dataPath; if (!runCfg.TestContext->IsFormatedDiskExpected()) { - if (runCfg.TestContext->Dir) { - TString databaseDirectory = MakeDatabasePath(runCfg.TestContext->Dir); - dataPath = MakePDiskPath(runCfg.TestContext->Dir); + auto dir = runCfg.TestContext->GetDir(); + if (dir) { + TString databaseDirectory = MakeDatabasePath(dir); + dataPath = MakePDiskPath(dir); MakeDirIfNotExist(databaseDirectory.c_str()); } diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_yard.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_yard.cpp index 81ec6061d88..8fc107ce9bb 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_yard.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_yard.cpp @@ -16,7 +16,7 @@ Y_UNIT_TEST_SUITE(TYardTest) { /* YARD_UNIT_TEST(TestLotsOfNonceJumps) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestInit<true, 1>>(&tc, 1, MIN_CHUNK_SIZE); // for (size_t i = 0; i < 3 * MIN_CHUNK_SIZE / 4096 / 5; ++i) { for (size_t i = 0; i < 204; ++i) { @@ -47,12 +47,12 @@ YARD_UNIT_TEST(TestLotsOfNonceJumps) { */ YARD_UNIT_TEST(TestBadDeviceInit) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestInitCorruptedError>(&tc, 1, MIN_CHUNK_SIZE, true); } YARD_UNIT_TEST(TestInit) { - TTestContext tc(false, true); + TTestContext tc(true); FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); Run<TTestInit<true, 1>>(&tc, 1, MIN_CHUNK_SIZE); Run<TTestInit<false, 2>>(&tc, 1, MIN_CHUNK_SIZE); @@ -60,7 +60,7 @@ YARD_UNIT_TEST(TestInit) { } YARD_UNIT_TEST(TestInitOnIncompleteFormat) { - TTestContext tc(false, true); + TTestContext tc(true); TTestRunConfig cfg(&tc); cfg.ChunkSize = MIN_CHUNK_SIZE; cfg.TestContext = &tc; @@ -71,51 +71,51 @@ YARD_UNIT_TEST(TestInitOnIncompleteFormat) { } YARD_UNIT_TEST(TestInitOwner) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestInitOwner>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestIncorrectRequests) { - TTestContext tc(false, true); + TTestContext tc(true); FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); Run<TTestIncorrectRequests>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestEmptyLogRead) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestEmptyLogRead>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestWholeLogRead) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestWholeLogRead>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestLogWriteRead) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLogWriteRead<17>>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestLogWriteReadMedium) { - TTestContext tc(false, true); + TTestContext tc(true); FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); Run<TTestLogWriteRead<6000>>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestLogWriteReadMediumWithHddSectorMap) { - TTestContext tc(false, true, NPDisk::NSectorMap::DM_HDD); + TTestContext tc(true, NPDisk::NSectorMap::DM_HDD); FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); Run<TTestLogWriteRead<6000>>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestLogWriteReadLarge) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLogWriteRead<9000>>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestLogWriteCutEqual) { for (int i = 0; i < 10; ++i) { - TTestContext tc(false, true); + TTestContext tc(true); FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); Run<TTestLogWriteCut<true>>(&tc, 2, MIN_CHUNK_SIZE); TTestLogWriteCut<true>::Reset(); @@ -125,7 +125,7 @@ YARD_UNIT_TEST(TestLogWriteCutEqual) { YARD_UNIT_TEST(TestLogWriteCutEqualRandomWait) { for (int i = 0; i < 10; ++i) { - TTestContext tc(false, true); + TTestContext tc(true); tc.SectorMap->ImitateRandomWait = {TDuration::MicroSeconds(500), TDuration::MicroSeconds(1000)}; FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); Run<TTestLogWriteCut<true>>(&tc, 2, MIN_CHUNK_SIZE); @@ -136,7 +136,7 @@ YARD_UNIT_TEST(TestLogWriteCutEqualRandomWait) { YARD_UNIT_TEST(TestSysLogReordering) { for (int i = 0; i < 10; ++i) { - TTestContext tc(false, true); + TTestContext tc(true); FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); Run<TTestSysLogReordering>(&tc, 5, MIN_CHUNK_SIZE); TTestSysLogReordering::VDiskNum = 0; @@ -146,7 +146,7 @@ YARD_UNIT_TEST(TestSysLogReordering) { } YARD_UNIT_TEST(TestLogWriteCutUnequal) { - TTestContext tc(false, true); + TTestContext tc(true); FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); Run<TTestLogWriteCut<false>>(&tc, 2, MIN_CHUNK_SIZE); TTestLogWriteCut<false>::Reset(); @@ -158,11 +158,11 @@ YARD_UNIT_TEST(TestLogWriteCutUnequal) { YARD_UNIT_TEST(TestChunkReadRandomOffset) { { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkReadRandomOffset<4096, 117, 10>>(&tc, 1, 8 << 20, false); } { - TTestContext tc(false, true); + TTestContext tc(true); constexpr ui32 sectorPayload = 4064; NPDisk::TDiskFormat format; format.Clear(); @@ -171,95 +171,95 @@ YARD_UNIT_TEST(TestChunkReadRandomOffset) { Run<TTestChunkReadRandomOffset<sizeWithHalfOfBlockSize, 217, 20>>(&tc, 1, 8 << 20, false); } { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkReadRandomOffset<1 << 20, 1525, 10>>(&tc, 1, 8 << 20, false); } { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkReadRandomOffset<2079573, 1450, 10>>(&tc, 1, 8 << 20, false); } } YARD_UNIT_TEST(TestChunkWriteRead) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkWriteRead<30000, 2 << 20>>(&tc, 1, 5 << 20); } YARD_UNIT_TEST(TestChunkWriteReadWithHddSectorMap) { - TTestContext tc(false, true, NPDisk::NSectorMap::DM_HDD); + TTestContext tc(true, NPDisk::NSectorMap::DM_HDD); Run<TTestChunkWriteRead<30000, 2 << 20>>(&tc, 1, 5 << 20); } YARD_UNIT_TEST(TestChunkWriteReadMultiple) { { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkWriteRead<6000000, 6500000>>(&tc, 1, 16 << 20, false); } { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkWriteRead<3000000, 3500000>>(&tc, 1, 8 << 20, false); } { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkWriteRead<2 << 20, 2 << 20>>(&tc, 1, 8 << 20, false); } { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkWriteRead<1000000, 1500000>>(&tc, 1, 4 << 20, false); } } YARD_UNIT_TEST(TestChunkWriteReadMultipleWithHddSectorMap) { { - TTestContext tc(false, true, NPDisk::NSectorMap::DM_HDD); + TTestContext tc(true, NPDisk::NSectorMap::DM_HDD); Run<TTestChunkWriteRead<6000000, 6500000>>(&tc, 1, 16 << 20, false); } { - TTestContext tc(false, true, NPDisk::NSectorMap::DM_HDD); + TTestContext tc(true, NPDisk::NSectorMap::DM_HDD); Run<TTestChunkWriteRead<3000000, 3500000>>(&tc, 1, 8 << 20, false); } { - TTestContext tc(false, true, NPDisk::NSectorMap::DM_HDD); + TTestContext tc(true, NPDisk::NSectorMap::DM_HDD); Run<TTestChunkWriteRead<2 << 20, 2 << 20>>(&tc, 1, 8 << 20, false); } { - TTestContext tc(false, true, NPDisk::NSectorMap::DM_HDD); + TTestContext tc(true, NPDisk::NSectorMap::DM_HDD); Run<TTestChunkWriteRead<1000000, 1500000>>(&tc, 1, 4 << 20, false); } } YARD_UNIT_TEST(TestChunkWriteReadWhole) { - TTestContext tc(false, true); + TTestContext tc(true); FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); Run<TTestChunkWriteReadWhole>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestChunkWriteReadWholeWithHddSectorMap) { - TTestContext tc(false, true, NPDisk::NSectorMap::DM_HDD); + TTestContext tc(true, NPDisk::NSectorMap::DM_HDD); FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); Run<TTestChunkWriteReadWhole>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestChunkWrite20Read02) { - TTestContext tc(false, true); + TTestContext tc(true); // 2 << 20 is the read/write burst size, that's why. Run<TTestChunkWrite20Read02>(&tc, 1, 2 << 20); } YARD_UNIT_TEST(TestStartingPoints) { - TTestContext tc(false, true); + TTestContext tc(true); FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); Run<TTestLogStartingPoint>(&tc, 1, MIN_CHUNK_SIZE); Run<TTestInitStartingPoints>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestLogMultipleWriteRead) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLogMultipleWriteRead<4000, 4100, 5000>>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestLogContinuityPersistence) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLogWrite<9000, 123>>(&tc, 1, MIN_CHUNK_SIZE); Run<TTestLogWrite<1000, 124>>(&tc, 1, MIN_CHUNK_SIZE); Run<TTestLogWrite<7000, 125>>(&tc, 1, MIN_CHUNK_SIZE); @@ -267,7 +267,7 @@ YARD_UNIT_TEST(TestLogContinuityPersistence) { } YARD_UNIT_TEST(TestLogContinuityPersistenceLarge) { - TTestContext tc(false, true); + TTestContext tc(true); FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); for (int i = 0; i < 4; ++i) { Run<TTestLogWrite<20000, 123>>(&tc, 1, MIN_CHUNK_SIZE); @@ -279,161 +279,161 @@ YARD_UNIT_TEST(TestLogContinuityPersistenceLarge) { } YARD_UNIT_TEST(TestLogWriteLsnConsistency) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLogWriteLsnConsistency<150>>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestChunkContinuity2) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunk3WriteRead<2>>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestChunkContinuity3000) { - TTestContext tc(false, true); + TTestContext tc(true); FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); Run<TTestChunk3WriteRead<3000>>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestChunkContinuity9000) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunk3WriteRead<9000>>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestChunkLock) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkLock>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestChunkUnlock) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkUnlock>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestChunkUnlockHarakiri) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkUnlockHarakiri>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestChunkUnlockRestart) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkUnlockRestart>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestChunkReserve) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkReserve>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestCheckSpace) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestCheckSpace>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestHttpInfo) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestHttpInfo>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestHttpInfoFileDoesntExist) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestHttpInfoFileDoesntExist>(&tc, 1, MIN_CHUNK_SIZE, true); } YARD_UNIT_TEST(TestBootingState) { - TTestContext tc(false, true); + TTestContext tc(true); FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); Run<TTestBootingState>(&tc, 1, MIN_CHUNK_SIZE, false, TString(), 5); } YARD_UNIT_TEST(TestWhiteboard) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestWhiteboard>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(Test3AsyncLog) { - TTestContext tc(false, true); + TTestContext tc(true); FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); Run<TTestLog3Write<100, 101, 102>>(&tc, 1, MIN_CHUNK_SIZE); Run<TTestLog3Read<100, 101, 102>>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestFirstRecordToKeep) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestFirstRecordToKeepWriteAB>(&tc, 1, MIN_CHUNK_SIZE); Run<TTestFirstRecordToKeepReadB>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestChunkRecommit) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkRecommit>(&tc); } YARD_UNIT_TEST(TestChunkRestartRecommit) { - TTestContext tc(false, true); + TTestContext tc(true); FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); Run<TTestChunkRestartRecommit1>(&tc, 1, MIN_CHUNK_SIZE); Run<TTestChunkRestartRecommit2>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestChunkDelete) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkDelete1>(&tc, 1, MIN_CHUNK_SIZE); Run<TTestChunkDelete2>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestChunkForget) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkForget1>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(Test3HugeAsyncLog) { - TTestContext tc(false, true); + TTestContext tc(true); constexpr ui32 chunkSize = MIN_CHUNK_SIZE; Run<TTestLog3Write<chunkSize / 2, chunkSize / 2, chunkSize * 2>>(&tc, 1, chunkSize); Run<TTestLog3Read<chunkSize / 2, chunkSize / 2, chunkSize * 2>>(&tc, 1, chunkSize); } YARD_UNIT_TEST(TestLotsOfTinyAsyncLogLatency) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLotsOfTinyAsyncLogLatency>(&tc); } YARD_UNIT_TEST(TestHugeChunkAndLotsOfTinyAsyncLogOrder) { - TTestContext tc(false, true); + TTestContext tc(true); FillDeviceWithZeroes(&tc, 128 << 20); Run<TTestHugeChunkAndLotsOfTinyAsyncLogOrder>(&tc); } YARD_UNIT_TEST(TestLogLatency) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLogLatency>(&tc); } YARD_UNIT_TEST(TestMultiYardLogLatency) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLogLatency>(&tc, 4); } YARD_UNIT_TEST(TestMultiYardFirstRecordToKeep) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestFirstRecordToKeepWriteAB>(&tc, 4, MIN_CHUNK_SIZE); Run<TTestFirstRecordToKeepReadB>(&tc, 4, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestMultiYardStartingPoints) { - TTestContext tc(false, true); + TTestContext tc(true); FillDeviceWithZeroes(&tc, MIN_CHUNK_SIZE); Run<TTestLogStartingPoint>(&tc, 4, MIN_CHUNK_SIZE); Run<TTestInitStartingPoints>(&tc, 4, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestMultiYardLogMultipleWriteRead) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLogMultipleWriteRead<4000, 4100, 5000>>(&tc, 4); } YARD_UNIT_TEST(TestSysLogOverwrite) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = 128 << 10; TString dataPath; @@ -477,7 +477,7 @@ YARD_UNIT_TEST(TestSysLogOverwrite) { /* YARD_UNIT_TEST(TestDamagedLogContinuityPersistence) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = 8 << 20; Run<TTestInit<true, 1>>(&tc, 1, chunkSize, false, true); @@ -498,7 +498,7 @@ YARD_UNIT_TEST(TestDamagedLogContinuityPersistence) { */ YARD_UNIT_TEST(TestDamagedFirstRecordToKeep) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; Run<TTestLogFillChunkPlus1>(&tc, 1, chunkSize); @@ -531,25 +531,25 @@ YARD_UNIT_TEST(TestDamagedFirstRecordToKeep) { YARD_UNIT_TEST(TestUpsAndDownsAtTheBoundary) { ui32 chunkSize = 8 << 20; { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLogWrite<7009 << 10, 1>>(&tc, 1, chunkSize); Run<TTestLogWrite<4000, 2>>(&tc, 1, chunkSize); Run<TTestLogWrite<4000, 3>>(&tc, 1, chunkSize); } { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLogWrite<7014 << 10, 4>>(&tc, 1, chunkSize); Run<TTestLogWrite<4000, 5>>(&tc, 1, chunkSize); Run<TTestLogWrite<4000, 6>>(&tc, 1, chunkSize); } { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLogWrite<7019 << 10, 7>>(&tc, 1, chunkSize); Run<TTestLogWrite<4000, 8>>(&tc, 1, chunkSize); Run<TTestLogWrite<4000, 9>>(&tc, 1, chunkSize); } { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLogWrite<7024 << 10, 10>>(&tc, 1, chunkSize); Run<TTestLogWrite<4000, 11>>(&tc, 1, chunkSize); Run<TTestLogWrite<4000, 12>>(&tc, 1, chunkSize); @@ -562,7 +562,7 @@ YARD_UNIT_TEST(TestDamageAtTheBoundary) { NPDisk::TAlignedData dataBefore(dataSize); NPDisk::TAlignedData dataAfter(dataSize); { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLogWrite<4000, 1>>(&tc, 1, chunkSize); ReadPdiskFile(&tc, dataSize, dataBefore); Run<TTestLogWrite<7009 << 10, 2>>(&tc, 1, chunkSize); @@ -572,7 +572,7 @@ YARD_UNIT_TEST(TestDamageAtTheBoundary) { Run<TTestLogWrite<4000, 4>>(&tc, 1, chunkSize); } { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLogWrite<4000, 5>>(&tc, 1, chunkSize); ReadPdiskFile(&tc, dataSize, dataBefore); Run<TTestLogWrite<7014 << 10, 6>>(&tc, 1, chunkSize); @@ -582,7 +582,7 @@ YARD_UNIT_TEST(TestDamageAtTheBoundary) { Run<TTestLogWrite<4000, 8>>(&tc, 1, chunkSize); } { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLogWrite<4000, 9>>(&tc, 1, chunkSize); ReadPdiskFile(&tc, dataSize, dataBefore); Run<TTestLogWrite<7019 << 10, 10>>(&tc, 1, chunkSize); @@ -592,7 +592,7 @@ YARD_UNIT_TEST(TestDamageAtTheBoundary) { Run<TTestLogWrite<4000, 12>>(&tc, 1, chunkSize); } { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestLogWrite<4000, 13>>(&tc, 1, chunkSize); ReadPdiskFile(&tc, dataSize, dataBefore); Run<TTestLogWrite<7024 << 10, 14>>(&tc, 1, chunkSize); @@ -604,7 +604,7 @@ YARD_UNIT_TEST(TestDamageAtTheBoundary) { } YARD_UNIT_TEST(TestUnflushedChunk) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; Run<TTestWriteAndReleaseChunk2A>(&tc, 1, chunkSize); @@ -623,7 +623,7 @@ YARD_UNIT_TEST(TestUnflushedChunk) { } YARD_UNIT_TEST(TestLogOverwriteRestarts) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; Run<TTestWriteAndCutLogChunk>(&tc, 1, chunkSize); for (ui32 i = 0; i < 15; ++i) { @@ -644,13 +644,13 @@ YARD_UNIT_TEST(TestLogOverwriteRestarts) { } YARD_UNIT_TEST(TestChunkFlushReboot) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkFlush>(&tc); Run<TTestChunkUnavailable>(&tc); } YARD_UNIT_TEST(TestRedZoneSurvivability) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; Ctest << "TestRedZoneSurvivability chunkSize# " << chunkSize << Endl; Run<TTestRedZoneSurvivability>(&tc, 1, chunkSize); @@ -658,7 +658,7 @@ YARD_UNIT_TEST(TestRedZoneSurvivability) { /* YARD_UNIT_TEST(TestNonceJumpRewriteMin) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; ui32 dataSize = 6 * chunkSize; NPDisk::TAlignedData data0(dataSize); @@ -694,7 +694,7 @@ YARD_UNIT_TEST(TestNonceJumpRewriteMin) { /* YARD_UNIT_TEST(TestNonceJumpRewrite) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; ui32 dataSize = 6 * chunkSize; NPDisk::TAlignedData data0(dataSize); @@ -733,32 +733,32 @@ YARD_UNIT_TEST(TestNonceJumpRewrite) { */ YARD_UNIT_TEST(TestSlay) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; FillDeviceWithZeroes(&tc, chunkSize); Run<TTestSlay>(&tc, 1, chunkSize); } YARD_UNIT_TEST(TestSlayRace) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; Run<TTestSlayRace>(&tc, 1, chunkSize); } YARD_UNIT_TEST(TestSlayRecreate) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; Run<TTestSlayRecreate>(&tc, 1, chunkSize); } YARD_UNIT_TEST(TestSlayLogWriteRaceActor) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; Run<TActorTestSlayLogWriteRace>(&tc, 1, chunkSize); } YARD_UNIT_TEST(TestMultiYardHarakiri) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; Ctest << Endl << "Fill with zeroes" << Endl; FillDeviceWithZeroes(&tc, chunkSize * 2); @@ -777,7 +777,7 @@ YARD_UNIT_TEST(TestMultiYardHarakiri) { } YARD_UNIT_TEST(TestDestroySystem) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; Run<TTestInit<true, 1>>(&tc, 1, chunkSize); @@ -793,18 +793,18 @@ YARD_UNIT_TEST(TestDestroySystem) { } YARD_UNIT_TEST(TestAllocateAllChunks) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestAllocateAllChunks>(&tc, 1, MIN_CHUNK_SIZE); } YARD_UNIT_TEST(TestChunkDeletionWhileWriting) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = 16 << 20; Run<TTestChunkDeletionWhileWritingIt>(&tc, 1, chunkSize); } YARD_UNIT_TEST(TestCutMultipleLogChunks) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; FillDeviceWithZeroes(&tc, chunkSize); Run<TTestCutMultipleLogChunks1>(&tc, 1, chunkSize); @@ -812,38 +812,38 @@ YARD_UNIT_TEST(TestCutMultipleLogChunks) { } YARD_UNIT_TEST(TestLogOwerwrite) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; Run<TTestLogOwerwrite1>(&tc, 1, chunkSize); Run<TTestLogOwerwrite2>(&tc, 1, chunkSize); } YARD_UNIT_TEST(TestDestructionWhileWritingChunk) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = 8 << 20; FillDeviceWithZeroes(&tc, chunkSize); Run<TTestDestructionWhileWritingChunk>(&tc, 1, chunkSize); } YARD_UNIT_TEST(TestDestructionWhileReadingChunk) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = 8 << 20; Run<TTestDestructionWhileReadingChunk>(&tc, 1, chunkSize); } YARD_UNIT_TEST(TestDestructionWhileReadingLog) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = 8 << 20; Run<TTestDestructionWhileReadingLog>(&tc, 1, chunkSize); } YARD_UNIT_TEST(TestChunkPriorityBlock) { - TTestContext tc(false, true); + TTestContext tc(true); Run<TTestChunkPriorityBlock>(&tc); } YARD_UNIT_TEST(TestFormatInfo) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; TString dataPath; if (tc.TempDir) { @@ -864,7 +864,7 @@ YARD_UNIT_TEST(TestFormatInfo) { } YARD_UNIT_TEST(TestStartingPointReboots) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; TString dataPath; if (tc.TempDir) { @@ -880,7 +880,7 @@ YARD_UNIT_TEST(TestStartingPointReboots) { } YARD_UNIT_TEST(TestRestartAtNonceJump) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; // Write a full chunk of logs (assume it's chunk# SystemChunkCount) Run<TTestContinueWriteLogChunk>(&tc, 1, chunkSize, false); @@ -910,7 +910,7 @@ YARD_UNIT_TEST(TestRestartAtNonceJump) { } YARD_UNIT_TEST(TestRestartAtChunkEnd) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = MIN_CHUNK_SIZE; // Write a full chunk of logs (assume it's chunk# SystemChunkCount) Run<TTestContinueWriteLogChunk>(&tc, 1, chunkSize, false); @@ -939,7 +939,7 @@ YARD_UNIT_TEST(TestRestartAtChunkEnd) { } YARD_UNIT_TEST(TestEnormousDisk) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = 512 << 20; ui64 diskSize = 100ull << 40; @@ -958,7 +958,7 @@ YARD_UNIT_TEST(TestEnormousDisk) { /* // TODO(cthulhu): Shorten test data, move it to a proper place YARD_UNIT_TEST(TestInitOnOldDisk) { - TTestContext tc(false, true); + TTestContext tc(true); ui32 chunkSize = 134217728; ui32 dataSize = 8 * chunkSize; NPDisk::TAlignedData data0(dataSize); diff --git a/ydb/core/blobstorage/pdisk/ut/ya.make b/ydb/core/blobstorage/pdisk/ut/ya.make index c08010de4d9..1b1c00bde84 100644 --- a/ydb/core/blobstorage/pdisk/ut/ya.make +++ b/ydb/core/blobstorage/pdisk/ut/ya.make @@ -27,16 +27,17 @@ SRCS( blobstorage_pdisk_blockdevice_ut.cpp blobstorage_pdisk_crypto_ut.cpp blobstorage_pdisk_log_cache_ut.cpp - blobstorage_pdisk_util_ut.cpp - blobstorage_pdisk_ut_env.cpp - blobstorage_pdisk_ut_races.cpp + blobstorage_pdisk_restore_ut.cpp blobstorage_pdisk_ut.cpp blobstorage_pdisk_ut_actions.cpp + blobstorage_pdisk_ut_color_limits.cpp + blobstorage_pdisk_ut_context.cpp + blobstorage_pdisk_ut_env.cpp blobstorage_pdisk_ut_helpers.cpp + blobstorage_pdisk_ut_races.cpp blobstorage_pdisk_ut_run.cpp blobstorage_pdisk_ut_sectormap.cpp - blobstorage_pdisk_restore_ut.cpp - blobstorage_pdisk_ut_color_limits.cpp + blobstorage_pdisk_util_ut.cpp mock/pdisk_mock.cpp ) |
