Repository navigation
ci(promql): Add extended PromQL support via vendored compliance tests. - #120849
nikitamikhaylov merged 17 commits into
Conversation
Vendor 14 stable engine-test files from prometheus/prometheus at 3da2514eff5ce503de2e8f355cae8ca58a2a35ed. CI reads only this snapshot.
Parse load, clear, eval, expected failures, and ordered results from the pinned snapshot. Give every eval an explicit status.
Load each scenario into a dedicated `TimeSeries` table and compare `prometheusQuery` / `prometheusQueryRange` output to expected results. Write both suites into one schema version 2 JSON file.
Accept schema version 2 JSON, compare each suite to the same suite in the master baseline, and omit an extended baseline when the old object has no such suite.
|
Workflow [PR], commit [8932f6d] Summary: ✅ AI ReviewSummaryThis PR vendors a pinned upstream Missing context / blind spots
Final Verdict✅ No new blocking review findings on the current PR head. |
A later load in the same scenario is not visible to an earlier eval. ClickHouse#120849
A one-row vector is not a scalar result. ClickHouse#120849
A shuffled timestamp sequence is a mismatch even when the values match. ClickHouse#120849
PromQL Compliance ReportBaseline: S3 master
Extended support (upstream engine tests): native-histogram exclusions: 149; excluded assertions: 248; upstream Note: Prometheus compliance score is unchanged vs baseline. |
|
@JTCunning not sure how to read this: substitution failed somewhere. |
… process per statement test_prometheus_protocols/test_compliance.py::test_promql_extended_support hits the 900s pytest-timeout on sanitizer flavours (Integration tests (amd_msan, 6/8): 4 FAIL against 349 OK over 7 days, plus one FAIL on amd_asan_ubsan, db disk, 6/8), which reds master and unrelated contributors' PRs. The suite was added in ClickHouse#120849. The test issues 983 statements over the vendored upstream promqltest corpus: one TRUNCATE per scenario, one INSERT per LOAD block, one SELECT per eval. Each went through node.query(), which forks a clickhouse client process and waits for it to exit, and ci/jobs/integration_test_job.py points CLICKHOUSE_TESTS_CLIENT_BIN_PATH at the same sanitizer-instrumented binary as the server, so every statement pays an instrumented process bootstrap. In the failing master run (sha 8db8b8d) 461s of the 900s window was spent outside any server connection, 51% of the wall clock, and the full corpus projects to 996s. It is not one heavy query: the slowest single query there took 10.9s and no inter-statement gap exceeded 11.5s. Sending those statements over the node's HTTP interface removes the process bootstrap and nothing else. The corpus, the statements and the comparisons are unchanged, and the two module-level DDL statements keep using the native protocol so the test still exercises it. Measured on one debug binary, before and after: test body 117.53s to 24.92s, statements reaching the native protocol 1118 to 135, client process launches 988 to 5, with all eight pinned suites.extended_support counters byte-identical (566 passed, 141 failed, 25 unsupported of 732). The 900s budget is kept rather than raised, so it stays a guard on PromQL evaluation cost, at roughly 1.8x projected margin on the worst run observed. http_wait_end_of_query=1 and the body-tail check are both needed. compare_eval treats a non-None error as the only thing that can make an expect_fail eval pass or classify an eval unsupported, while http_query_and_get_answer_with_error decides success on the HTTP status alone, and ClickHouse can answer 200 with the exception appended to the response body once part of the response has been flushed. The setting holds the response server-side until the query resolves so a failure arrives as an error status, and the regex covers the residual shape, which does reproduce on this build when send_progress_in_http_headers commits the headers early. Without them the 13 expect_fail evals would have flipped to failed with nothing turning red.
This vendors tests from prometheus/prometheus as the canonical way to test for compliance.
Unfortunately, prometheus/compliance tests for a subset of functions, and is not an accurate representation of a "fully compatible drop-in replacement."
Instead of replacing the original tests and showing a regression, I've opted for adding a second line to the compliance report.
This PR looks huge because of the vendored files. It's pretty small otherwise.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
N/A
Workflow [PR]
Sync PR [sync-upstream/pr/120849]
Version info
26.10.1.465-master(included in26.10and later)