88#include < library/cpp/testing/unittest/registar.h>
99#include < library/cpp/threading/future/async.h>
1010
11- // ad-hoc test parametrization support: only for single boolean flag
12- // taken from ydb/core/ut/common/kqp_ut_common.h:Y_UNIT_TEST_TWIN
13- // TODO: introduce general support for test parametrization?
14- #define Y_UNIT_TEST_FLAG (N, OPT ) \
15- template <bool OPT> void N (NUnitTest::TTestContext&); \
16- struct TTestRegistration ##N { \
17- TTestRegistration##N() { \
18- TCurrentTest::AddTest (#N " -" #OPT " -false" , static_cast <void (*)(NUnitTest::TTestContext&)>(&N<false >), false ); \
19- TCurrentTest::AddTest (#N " -" #OPT " -true" , static_cast <void (*)(NUnitTest::TTestContext&)>(&N<true >), false ); \
20- } \
21- }; \
22- static TTestRegistration##N testRegistration##N; \
23- template <bool OPT> \
24- void N (NUnitTest::TTestContext&)
25-
2611namespace NKikimr ::NFlatTxCoordinator::NTest {
2712
2813 using namespace Tests ;
@@ -394,7 +379,7 @@ namespace NKikimr::NFlatTxCoordinator::NTest {
394379 Ydb::Cms::CreateDatabaseRequest,
395380 Ydb::Cms::CreateDatabaseResponse>;
396381
397- Y_UNIT_TEST_FLAG (RestoreTenantConfiguration, AlterDatabaseCreateHiveFirst ) {
382+ Y_UNIT_TEST (RestoreTenantConfiguration) {
398383 struct TCoordinatorHooks : public ICoordinatorHooks {
399384 bool AllowPersistConfig_ = true ;
400385 std::unordered_map<ui64, NKikimrSubDomains::TProcessingParams> PersistConfig_;
@@ -412,8 +397,7 @@ namespace NKikimr::NFlatTxCoordinator::NTest {
412397 .SetNodeCount (1 )
413398 .SetDynamicNodeCount (4 )
414399 .SetUseRealThreads (false )
415- .AddStoragePoolType (" ssd" )
416- .SetEnableAlterDatabaseCreateHiveFirst (AlterDatabaseCreateHiveFirst);
400+ .AddStoragePoolType (" ssd" );
417401
418402 Tests::TServer::TPtr server = new TServer (serverSettings);
419403
@@ -430,8 +414,6 @@ namespace NKikimr::NFlatTxCoordinator::NTest {
430414 hooks.AllowPersistConfig_ = false ;
431415 hooks.PersistConfig_ .clear ();
432416
433- const ui32 ExpectedProcessingParamsVersion = 2 + (AlterDatabaseCreateHiveFirst ? 1 : 0 );
434-
435417 auto createDatabase = [&]() {
436418 Ydb::Cms::CreateDatabaseRequest request;
437419 request.set_path (" /Root/db1" );
@@ -463,8 +445,8 @@ namespace NKikimr::NFlatTxCoordinator::NTest {
463445 UNIT_ASSERT_C (hooks.PersistConfig_ .size () > 0 , " Expected coordinators to attempt to persist configs" );
464446 std::vector<ui64> coordinators;
465447 for (auto & pr : hooks.PersistConfig_ ) {
466- UNIT_ASSERT_C (pr.second .GetVersion () == ExpectedProcessingParamsVersion ,
467- " Expected tenant coordinator to have a version " << ExpectedProcessingParamsVersion << " config:\n " << pr.second .DebugString ());
448+ UNIT_ASSERT_C (pr.second .GetVersion () == 2 ,
449+ " Expected tenant coordinator to have a version 2 config:\n " << pr.second .DebugString ());
468450 coordinators.push_back (pr.first );
469451 }
470452
@@ -478,8 +460,8 @@ namespace NKikimr::NFlatTxCoordinator::NTest {
478460 runtime.SimulateSleep (TDuration::MilliSeconds (50 ));
479461 UNIT_ASSERT_C (hooks.PersistConfig_ .size () == coordinators.size (), " Expected all coordinators to persist restored config" );
480462 for (auto & pr : hooks.PersistConfig_ ) {
481- UNIT_ASSERT_C (pr.second .GetVersion () == ExpectedProcessingParamsVersion ,
482- " Expected tenant coordinator to restore a version " << ExpectedProcessingParamsVersion << " config:\n " << pr.second .DebugString ());
463+ UNIT_ASSERT_C (pr.second .GetVersion () == 2 ,
464+ " Expected tenant coordinator to restore a version 2 config:\n " << pr.second .DebugString ());
483465 }
484466
485467 // runtime.SetLogPriority(NKikimrServices::TABLET_MAIN, NActors::NLog::PRI_DEBUG);
0 commit comments