Skip to content

Commit c05625d

Browse files
authored
YQ WM fix unit tests counters validation (#7030)
1 parent eeb2175 commit c05625d

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

ydb/core/kqp/workload_service/ut/common/kqp_workload_service_ut_common.cpp

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ class TWorkloadServiceYdbSetup : public IYdbSetup {
453453
auto subgroup = GetWorkloadManagerCounters(nodeIndex)
454454
->GetSubgroup("pool", CanonizePath(TStringBuilder() << Settings_.DomainName_ << "/" << (poolId ? poolId : Settings_.PoolId_)));
455455

456-
const TString description = TStringBuilder() << "Node index: " << nodeIndex;
456+
const TString description = TStringBuilder() << "Node id: " << GetRuntime()->GetNodeId(nodeIndex);
457457
CheckCommonCounters(subgroup, description);
458458
if (checkTableCounters) {
459459
CheckTableCounters(subgroup, description);
@@ -505,30 +505,23 @@ class TWorkloadServiceYdbSetup : public IYdbSetup {
505505
UNIT_ASSERT_VALUES_EQUAL_C(subgroup->GetCounter("ContinueError", true)->Val(), 0, description);
506506
UNIT_ASSERT_VALUES_EQUAL_C(subgroup->GetCounter("CleanupError", true)->Val(), 0, description);
507507
UNIT_ASSERT_VALUES_EQUAL_C(subgroup->GetCounter("Cancelled", true)->Val(), 0, description);
508-
509-
UNIT_ASSERT_GE_C(subgroup->GetCounter("ContinueOk", true)->Val(), 1, description);
510-
UNIT_ASSERT_VALUES_EQUAL_C(subgroup->GetCounter("ContinueOk", true)->Val(), subgroup->GetCounter("CleanupOk", true)->Val(), description);
511508
}
512509

513510
static void CheckTableCounters(NMonitoring::TDynamicCounterPtr subgroup, const TString& description) {
514511
UNIT_ASSERT_VALUES_EQUAL_C(subgroup->GetCounter("PendingRequestsCount", false)->Val(), 0, description);
515512
UNIT_ASSERT_VALUES_EQUAL_C(subgroup->GetCounter("FinishingRequestsCount", false)->Val(), 0, description);
516513

517-
const std::vector<std::pair<TString, bool>> tableQueries = {
518-
{"TCleanupTablesQuery", false},
519-
{"TRefreshPoolStateQuery", true},
520-
{"TDelayRequestQuery", true},
521-
{"TStartFirstDelayedRequestQuery", true},
522-
{"TStartRequestQuery", false},
523-
{"TCleanupRequestsQuery", true},
514+
const std::vector<TString> tableQueries = {
515+
"TCleanupTablesQuery",
516+
"TRefreshPoolStateQuery",
517+
"TDelayRequestQuery",
518+
"TStartFirstDelayedRequestQuery",
519+
"TStartRequestQuery",
520+
"TCleanupRequestsQuery",
524521
};
525-
for (const auto& [operation, runExpected] : tableQueries) {
522+
for (const auto& operation : tableQueries) {
526523
auto operationSubgroup = subgroup->GetSubgroup("operation", operation);
527-
528524
UNIT_ASSERT_VALUES_EQUAL_C(operationSubgroup->GetCounter("FinishError", true)->Val(), 0, TStringBuilder() << description << ", unexpected vaule for operation " << operation);
529-
if (runExpected) {
530-
UNIT_ASSERT_GE_C(operationSubgroup->GetCounter("FinishOk", true)->Val(), 1, TStringBuilder() << description << ", unexpected vaule for operation " << operation);
531-
}
532525
}
533526
}
534527

0 commit comments

Comments
 (0)