Skip to content

Commit 29e79cd

Browse files
authored
Fixed return code of benchmark command for the case when query results differ from canonical ones (#16192) (#16210)
1 parent 2872ba0 commit 29e79cd

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

ydb/apps/ydb/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* Fixed return code of command `ydb workload * run --check-canonical` for the case when benchmark query results differ from canonical ones.
12
* Added support for dual configuration mode in the `ydb admin cluster config fetch` command, allowing it to handle separate cluster and storage config sections.
23
* Add options for client certificates in SSL/TLS connections.
34
* Add `ydb admin node config init` command to initialize directory with node config files.

ydb/public/lib/ydb_cli/commands/ydb_benchmark.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ int TWorkloadCommandBenchmark::RunBench(TClient* client, NYdbWorkload::IWorkload
488488
Cout << "Summary table saved in CSV format to " << CsvReportFileName << Endl;
489489
}
490490

491-
return queriesWithSomeFails ? EXIT_FAILURE : EXIT_SUCCESS;
491+
return (queriesWithSomeFails || queriesWithDiff) ? EXIT_FAILURE : EXIT_SUCCESS;
492492
}
493493

494494
void TWorkloadCommandBenchmark::PrintResult(const BenchmarkUtils::TQueryBenchmarkResult& res, IOutputStream& out, const std::string& expected) const {

ydb/tests/olap/lib/ydb_cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def _process_returncode(self, returncode) -> None:
167167
self._init_iter(iter)
168168
self.result.iterations[iter].error_message = msg
169169
self._add_error(f'Iteration {iter}: {msg}')
170-
if returncode != 0 and len([x for x in filter(lambda x: x.error_message, self.result.iterations.values())]) == 0:
170+
if returncode != 0 and len([x for x in filter(lambda x: x.error_message or x.warning_message, self.result.iterations.values())]) == 0:
171171
self._add_error(f'Invalid return code: {returncode} instead 0. stderr: {self.result.stderr}')
172172

173173
def _load_plan(self, name: str) -> YdbCliHelper.QueryPlan:

0 commit comments

Comments
 (0)