aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhor911 <hor911@ydb.tech>2022-11-09 20:49:15 +0300
committerhor911 <hor911@ydb.tech>2022-11-09 20:49:15 +0300
commitf08ddb7b69dd9da61be6f99f8c0e4b22c5bac4dd (patch)
treeb3f342148d778856c7e2e903b97555b4b4efd6bd
parentb681e93691425927769e98be40a5750be2a45740 (diff)
downloadydb-f08ddb7b69dd9da61be6f99f8c0e4b22c5bac4dd.tar.gz
Fix ControlPlaneProxy UTs
-rw-r--r--ydb/core/yq/libs/control_plane_config/control_plane_config.cpp4
-rw-r--r--ydb/core/yq/libs/control_plane_proxy/ut/control_plane_proxy_ut.cpp9
2 files changed, 11 insertions, 2 deletions
diff --git a/ydb/core/yq/libs/control_plane_config/control_plane_config.cpp b/ydb/core/yq/libs/control_plane_config/control_plane_config.cpp
index 6f22f18875..b260bef85f 100644
--- a/ydb/core/yq/libs/control_plane_config/control_plane_config.cpp
+++ b/ydb/core/yq/libs/control_plane_config/control_plane_config.cpp
@@ -65,9 +65,9 @@ public:
void Bootstrap() {
CPC_LOG_D("STARTING: " << SelfId());
Become(&TControlPlaneConfigActor::StateFunc);
- YdbConnection = NewYdbConnection(Config.GetStorage(), CredProviderFactory, YqSharedResources->CoreYdbDriver);
- DbPool = YqSharedResources->DbPoolHolder->GetOrCreate(EDbPoolId::MAIN, 10, YdbConnection->TablePathPrefix);
if (Config.GetUseDbMapping()) {
+ YdbConnection = NewYdbConnection(Config.GetStorage(), CredProviderFactory, YqSharedResources->CoreYdbDriver);
+ DbPool = YqSharedResources->DbPoolHolder->GetOrCreate(EDbPoolId::MAIN, 10, YdbConnection->TablePathPrefix);
Schedule(TDuration::Zero(), new NActors::TEvents::TEvWakeup());
} else {
TenantInfo.reset(new TTenantInfo());
diff --git a/ydb/core/yq/libs/control_plane_proxy/ut/control_plane_proxy_ut.cpp b/ydb/core/yq/libs/control_plane_proxy/ut/control_plane_proxy_ut.cpp
index 84fd77aefb..7a5beb2722 100644
--- a/ydb/core/yq/libs/control_plane_proxy/ut/control_plane_proxy_ut.cpp
+++ b/ydb/core/yq/libs/control_plane_proxy/ut/control_plane_proxy_ut.cpp
@@ -1,4 +1,5 @@
#include <ydb/core/yq/libs/actors/logging/log.h>
+#include <ydb/core/yq/libs/control_plane_config/control_plane_config.h>
#include <ydb/core/yq/libs/control_plane_proxy/control_plane_proxy.h>
#include <ydb/core/yq/libs/control_plane_storage/control_plane_storage.h>
#include <ydb/core/yq/libs/control_plane_storage/events/events.h>
@@ -363,6 +364,14 @@ private:
0
);
+ auto configService = CreateControlPlaneConfigActor(NYq::TYqSharedResources::TPtr{}, NKikimr::TYdbCredentialsProviderFactory(nullptr),
+ NConfig::TControlPlaneStorageConfig{}, MakeIntrusive<::NMonitoring::TDynamicCounters>());
+ runtime->AddLocalService(
+ NYq::ControlPlaneConfigActorId(),
+ TActorSetupCmd(configService, TMailboxType::Simple, 0),
+ 0
+ );
+
MetaStorageGrab = new TGrabActor(runtime);
runtime->AddLocalService(
ControlPlaneStorageServiceActorId(),