summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorivanmorozov <[email protected]>2023-06-13 18:26:05 +0300
committerivanmorozov <[email protected]>2023-06-13 18:26:05 +0300
commitc734b6624dec0175d33d3598fb4061e152e83c32 (patch)
tree5a85722e9b87d716a42a03a80350db78db57aa98
parent38186d856319088fde3eab19e04df32dc074d6e5 (diff)
fix exceptions processing
-rw-r--r--ydb/public/lib/ydb_cli/commands/click_bench.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/ydb/public/lib/ydb_cli/commands/click_bench.cpp b/ydb/public/lib/ydb_cli/commands/click_bench.cpp
index 0e506f38268..8ff5dfebb28 100644
--- a/ydb/public/lib/ydb_cli/commands/click_bench.cpp
+++ b/ydb/public/lib/ydb_cli/commands/click_bench.cpp
@@ -155,7 +155,12 @@ bool TClickBenchCommandRun::RunBench(TConfig& config)
TString prevResult = "";
for (ui32 i = 0; i < IterationsCount * 10 && successIteration < IterationsCount; ++i) {
auto t1 = TInstant::Now();
- auto res = Execute(query, client);
+ std::pair<TString, TString> res;
+ try {
+ res = Execute(query, client);
+ } catch (...) {
+ res = std::make_pair<TString, TString>("", CurrentExceptionMessage());
+ }
if (prevResult != res.first && !qInfo.IsCorrectResult(res.first)) {
outFStream << queryN << ": UNEXPECTED DIFF: " << Endl
<< "RESULT: " << Endl << res.first << Endl
@@ -173,6 +178,12 @@ bool TClickBenchCommandRun::RunBench(TConfig& config)
outFStream << queryN << ": " << Endl
<< res.first << res.second << Endl << Endl;
}
+ if (prevResult != res.first && !qInfo.IsCorrectResult(res.first)) {
+ outFStream << queryN << ": UNEXPECTED DIFF: " << Endl
+ << "RESULT: " << Endl << res.first << Endl
+ << "EXPECTATION: " << Endl << qInfo.GetExpectedResult() << Endl;
+ prevResult = res.first;
+ }
} else {
Cout << "failed\t" << duration << " seconds" << Endl;
Cerr << queryN << ": " << query << Endl