Skip to content

fix KqpRequestContext::TraceIdInErrorMessage KIKIMR-20753 #1154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions ydb/core/kqp/ut/scan/kqp_scan_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2583,27 +2583,39 @@ Y_UNIT_TEST_SUITE(KqpRequestContext) {
auto settings = TKikimrSettings()
.SetAppConfig(AppCfg())
.SetEnableScriptExecutionOperations(true)
.SetNodeCount(4);
.SetNodeCount(4)
.SetUseRealThreads(false);
TKikimrRunner kikimr{settings};
auto db = kikimr.GetTableClient();

NKikimr::NKqp::TKqpPlanner::UseMockEmptyPlanner = true;
Y_DEFER {
NKikimr::NKqp::TKqpPlanner::UseMockEmptyPlanner = false; // just in case if test fails
};

auto it = db.StreamExecuteScanQuery(R"(
SELECT Text, SUM(Key) AS Total FROM `/Root/EightShard`
GROUP BY Text
ORDER BY Total DESC;
)").GetValueSync();
{
TDispatchOptions opts;
opts.FinalEvents.emplace_back(NKikimr::NKqp::TKqpResourceInfoExchangerEvents::EvSendResources, 4);
kikimr.GetTestServer().GetRuntime()->DispatchEvents(opts);
}

auto it = kikimr.RunCall([&db] {
return db.StreamExecuteScanQuery(R"(
SELECT Text, SUM(Key) AS Total FROM `/Root/EightShard`
GROUP BY Text
ORDER BY Total DESC;
)").GetValueSync();
});

UNIT_ASSERT(it.IsSuccess());
try {
auto yson = StreamResultToYson(it, true, NYdb::EStatus::PRECONDITION_FAILED, "TraceId");
} catch (const std::exception& ex) {
UNIT_ASSERT_C(false, "Exception NYdb::EStatus::PRECONDITION_FAILED not found or IssueMessage doesn't contain 'TraceId'");
}
kikimr.RunCall([&it] {
try {
auto yson = StreamResultToYson(it, true, NYdb::EStatus::PRECONDITION_FAILED, "TraceId");
} catch (const std::exception& ex) {
UNIT_ASSERT_C(false, "Exception NYdb::EStatus::PRECONDITION_FAILED not found or IssueMessage doesn't contain 'TraceId'");
}
return true;
});

NKikimr::NKqp::TKqpPlanner::UseMockEmptyPlanner = false;
}
Expand Down