Repository navigation
Send the PromQL extended-support suite's statements over HTTP instead of forking a client per statement - #121862
Conversation
… 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.
Internal second-model review (click to expand)An independent cold review and a separate second-model gate both ran against this head. No blocker ❌ Blockers /
💡 Nits, none blocking:
Also looked at, deliberately not raised: three other integration tests sit near the same 900 s |
|
Workflow [PR], commit [4545297] Summary: ✅ AI ReviewSummaryThis PR switches the extended PromQL compliance suite from Final Verdict
|
326a33a
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
test_compliance.py::test_promql_extended_support, added by #120849, hits the 900 s per-testpytest-timeouton sanitizer flavours. Since the merge it has reddened 2 master runs and 5 unrelatedPRs, all within 2h10 today:
amd_msan, 6/86 FAIL / 365 OK,amd_asan_ubsan, db disk, 6/81 FAIL / 444 OK. Failing master run:
sha 8db8b8de.
Root cause. The test issues 983 statements (123
TRUNCATE, 128INSERT, 732 evalSELECT), eachthrough
node.query(), which forks aclickhouse client; CI points it at the same sanitizer-builtbinary as the server, so each statement pays an instrumented process bootstrap: 461 s of that run's
900 s budget, projecting to 996 s. Not one slow query, the slowest took 10.9 s; the budget expires on
whichever statement is in flight.
Change. Route those 983 statements over the node's HTTP interface, which has no process to start.
Corpus, queries and comparisons untouched; the 2 module-level DDL statements stay native and
test_evaluation.pykeeps native coverage of these table functions.http_wait_end_of_query=1plus abody-tail check keep an exception an exception: HTTP can answer 200 with the error in the body, and
compare_evalneeds a non-Noneerror for the 13expect_failevals and everyunsupportedclassification. A timeout bump would leave the waste in place and retire the budget as a guard.
Validation, before -> after: test body 117.53 s -> 24.92 s (4.72x), native-protocol statements
1118 -> 135, client launches 988 -> 5, and all 8 pinned
suites.extended_supportcountersbyte-identical across 2 pre-fix and 5 post-fix runs. Projected
amd_msancost ~490 s of 900 s on theworst run seen.
Disclosure: the printed
FAILURE BREAKDOWNkeys collapse duplicates (119 -> 78, identical totals); thePromQL Compliancejob reads only those counters.Workflow [PR]
Sync PR [sync-upstream/pr/121862]
Version info
26.10.1.595-master(included in26.10and later)