Skip to content

Fixed return code of benchmark command for the case when query results differ from canonical ones #16192

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
Mar 25, 2025
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
2 changes: 1 addition & 1 deletion ydb/apps/ydb/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

* Fixed return code of command `ydb workload * run --check-canonical` for the case when benchmark query results differ from canonical ones.
## 2.20.0 ##

* Added support for dual configuration mode in the `ydb admin cluster config fetch` command, allowing it to handle separate cluster and storage config sections.
2 changes: 1 addition & 1 deletion ydb/public/lib/ydb_cli/commands/ydb_benchmark.cpp
Original file line number Diff line number Diff line change
@@ -488,7 +488,7 @@ int TWorkloadCommandBenchmark::RunBench(TClient* client, NYdbWorkload::IWorkload
Cout << "Summary table saved in CSV format to " << CsvReportFileName << Endl;
}

return queriesWithSomeFails ? EXIT_FAILURE : EXIT_SUCCESS;
return (queriesWithSomeFails || queriesWithDiff) ? EXIT_FAILURE : EXIT_SUCCESS;
}

void TWorkloadCommandBenchmark::PrintResult(const BenchmarkUtils::TQueryBenchmarkResult& res, IOutputStream& out, const std::string& expected) const {
2 changes: 1 addition & 1 deletion ydb/tests/olap/lib/ydb_cli.py
Original file line number Diff line number Diff line change
@@ -167,7 +167,7 @@ def _process_returncode(self, returncode) -> None:
self._init_iter(iter)
self.result.iterations[iter].error_message = msg
self._add_error(f'Iteration {iter}: {msg}')
if returncode != 0 and len([x for x in filter(lambda x: x.error_message, self.result.iterations.values())]) == 0:
if returncode != 0 and len([x for x in filter(lambda x: x.error_message or x.warning_message, self.result.iterations.values())]) == 0:
self._add_error(f'Invalid return code: {returncode} instead 0. stderr: {self.result.stderr}')

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