Skip to content

Commit 70be00c

Browse files
authored
Fixed return code of benchmark command for the case when query results differ from canonical ones (#16192)
1 parent bc40682 commit 70be00c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

ydb/apps/ydb/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
* Fixed return code of command `ydb workload * run --check-canonical` for the case when benchmark query results differ from canonical ones.
22
## 2.20.0 ##
33

44
* Added support for dual configuration mode in the `ydb admin cluster config fetch` command, allowing it to handle separate cluster and storage config sections.

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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)