Skip to content

Commit 77b77cc

Browse files
authored
YQ kqprun remove start message (#7490)
1 parent 58580f8 commit 77b77cc

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

ydb/core/testlib/test_client.cpp

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,9 @@ namespace Tests {
566566
hostConfig.SetHostConfigId(nodeId);
567567
TString path = TStringBuilder() << Runtime->GetTempDir() << "pdisk_1.dat";
568568
hostConfig.AddDrive()->SetPath(path);
569-
Cerr << "test_client.cpp: SetPath # " << path << Endl;
569+
if (Settings->Verbose) {
570+
Cerr << "test_client.cpp: SetPath # " << path << Endl;
571+
}
570572
bsConfigureRequest->Record.MutableRequest()->AddCommand()->MutableDefineHostConfig()->CopyFrom(hostConfig);
571573

572574
auto& host = *boxConfig.AddHost();
@@ -1254,6 +1256,7 @@ namespace Tests {
12541256
, DomainName(settings.DomainName)
12551257
, SupportsRedirect(settings.SupportsRedirect)
12561258
, StoragePoolTypes(settings.StoragePoolTypes)
1259+
, Verbose(settings.Verbose)
12571260
, FunctionRegistry(NKikimr::NMiniKQL::CreateFunctionRegistry(NKikimr::NMiniKQL::CreateBuiltinRegistry()))
12581261
, LoadedFunctionRegistry(NKikimr::NMiniKQL::CreateFunctionRegistry(NKikimr::NMiniKQL::CreateBuiltinRegistry()))
12591262
{
@@ -1272,7 +1275,9 @@ namespace Tests {
12721275
Client.reset(new NMsgBusProxy::TMsgBusClient(ClientConfig));
12731276
Client->Init();
12741277

1275-
Cerr << "TClient is connected to server " << ClientConfig.Ip << ":" << ClientConfig.Port << Endl;
1278+
if (Verbose) {
1279+
Cerr << "TClient is connected to server " << ClientConfig.Ip << ":" << ClientConfig.Port << Endl;
1280+
}
12761281
}
12771282

12781283
const NMsgBusProxy::TMsgBusClientConfig& TClient::GetClientConfig() const {
@@ -1350,13 +1355,17 @@ namespace Tests {
13501355

13511356
void TClient::WaitRootIsUp(const TString& root) {
13521357
while (true) {
1353-
Cerr << "WaitRootIsUp '" << root << "'..." << Endl;
1358+
if (Verbose) {
1359+
Cerr << "WaitRootIsUp '" << root << "'..." << Endl;
1360+
}
13541361

13551362
TAutoPtr<NMsgBusProxy::TBusResponse> resp = Ls(root);
13561363
UNIT_ASSERT(resp);
13571364

13581365
if (resp->Record.GetStatus() == NMsgBusProxy::MSTATUS_OK && resp->Record.GetSchemeStatus() == NKikimrScheme::StatusSuccess) {
1359-
Cerr << "WaitRootIsUp '" << root << "' success." << Endl;
1366+
if (Verbose) {
1367+
Cerr << "WaitRootIsUp '" << root << "' success." << Endl;
1368+
}
13601369
break;
13611370
}
13621371
}
@@ -1381,7 +1390,9 @@ namespace Tests {
13811390
TAutoPtr<NBus::TBusMessage> reply;
13821391
SendAndWaitCompletion(request, reply);
13831392

1384-
Cout << PrintToString<NMsgBusProxy::TBusResponse>(reply.Get()) << Endl;
1393+
if (Verbose) {
1394+
Cout << PrintToString<NMsgBusProxy::TBusResponse>(reply.Get()) << Endl;
1395+
}
13851396
return reply;
13861397
}
13871398

@@ -1411,7 +1422,9 @@ namespace Tests {
14111422
msg->Record.MutableFlatTxId()->SetSchemeShardTabletId(schemeshard);
14121423
msg->Record.MutableFlatTxId()->SetPathId(pathId);
14131424
msg->Record.MutablePollOptions()->SetTimeout(timeout.MilliSeconds());
1414-
Cerr << "waiting..." << Endl;
1425+
if (Verbose) {
1426+
Cerr << "waiting..." << Endl;
1427+
}
14151428
status = SyncCall(msg, reply);
14161429
if (status != NBus::MESSAGE_OK) {
14171430
const char *description = NBus::MessageStatusDescription(status);
@@ -1949,7 +1962,9 @@ namespace Tests {
19491962
}
19501963

19511964
TAutoPtr<NMsgBusProxy::TBusResponse> TClient::LsImpl(const TString& path) {
1952-
Cerr << "TClient::Ls request: " << path << Endl;
1965+
if (Verbose) {
1966+
Cerr << "TClient::Ls request: " << path << Endl;
1967+
}
19531968

19541969
TAutoPtr<NMsgBusProxy::TBusSchemeDescribe> request(new NMsgBusProxy::TBusSchemeDescribe());
19551970
request->Record.SetPath(path);
@@ -1958,7 +1973,9 @@ namespace Tests {
19581973
NBus::EMessageStatus msgStatus = SendWhenReady(request, reply);
19591974
UNIT_ASSERT_VALUES_EQUAL(msgStatus, NBus::MESSAGE_OK);
19601975

1961-
Cerr << "TClient::Ls response: " << PrintToString<NMsgBusProxy::TBusResponse>(reply.Get()) << Endl;
1976+
if (Verbose) {
1977+
Cerr << "TClient::Ls response: " << PrintToString<NMsgBusProxy::TBusResponse>(reply.Get()) << Endl;
1978+
}
19621979

19631980
return dynamic_cast<NMsgBusProxy::TBusResponse*>(reply.Release());
19641981
}

ydb/core/testlib/test_client.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ namespace Tests {
157157
NYql::IYtGateway::TPtr YtGateway;
158158
bool InitializeFederatedQuerySetupFactory = false;
159159
TString ServerCertFilePath;
160+
bool Verbose = true;
160161

161162
std::function<IActor*(const TTicketParserSettings&)> CreateTicketParser = NKikimr::CreateTicketParser;
162163
std::shared_ptr<TGrpcServiceFactory> GrpcServiceFactory;
@@ -207,6 +208,7 @@ namespace Tests {
207208
TServerSettings& SetComputationFactory(NMiniKQL::TComputationNodeFactory computationFactory) { ComputationFactory = std::move(computationFactory); return *this; }
208209
TServerSettings& SetYtGateway(NYql::IYtGateway::TPtr ytGateway) { YtGateway = std::move(ytGateway); return *this; }
209210
TServerSettings& SetInitializeFederatedQuerySetupFactory(bool value) { InitializeFederatedQuerySetupFactory = value; return *this; }
211+
TServerSettings& SetVerbose(bool value) { Verbose = value; return *this; }
210212
TServerSettings& SetPersQueueGetReadSessionsInfoWorkerFactory(
211213
std::shared_ptr<NKikimr::NMsgBusProxy::IPersQueueGetReadSessionsInfoWorkerFactory> factory
212214
) {
@@ -594,6 +596,7 @@ namespace Tests {
594596
const TString DomainName;
595597
const bool SupportsRedirect;
596598
const TStoragePoolKinds StoragePoolTypes;
599+
const bool Verbose;
597600
NScheme::TKikimrTypeRegistry TypeRegistry;
598601
TIntrusivePtr<NMiniKQL::IFunctionRegistry> FunctionRegistry;
599602
NMsgBusProxy::TMsgBusClientConfig ClientConfig;

ydb/tests/tools/kqprun/src/ydb_setup.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ class TYdbSetup::TImpl {
142142
serverSettings.SetYtGateway(Settings_.YtGateway);
143143
serverSettings.S3ActorsFactory = NYql::NDq::CreateS3ActorsFactory();
144144
serverSettings.SetInitializeFederatedQuerySetupFactory(true);
145+
serverSettings.SetVerbose(false);
145146

146147
SetLoggerSettings(serverSettings);
147148
SetFunctionRegistry(serverSettings);

0 commit comments

Comments
 (0)