test(e2e)+fix(engine): Tests 6+7 strict-success via count_over_time - #266
Merged
Merged
Conversation
PR #265 wired `count_over_time(metric[range])` to `Capability::FrequencyEstimate(Any)`. This PR consumes that surface: Tests 6 + 7 promote from soft-check (assert `status` field exists) to strict-success (assert `status == "success"` + non-empty result vector). Two underlying fixes surfaced when wiring this up: 1. **`build_count_min_export` was hardcoding wire `rows`/`cols` to 0** — the policy_fp content match keys on `parameters.{d, w}` against the DP's wire dimensions, so heap-less CMS sids were always registering with `policy_fp = UNSET` (unreachable through `sids_for_policy`). Same bug as the heap-bearing helpers had before PR #258 fixed them. Added `wire_rows: i32, wire_cols: i32` parameters mirroring `build_cms_with_heap_msgpack_export`'s shape. 2. **`asap_tier_result_to_query_result(.., is_range_query=true)` returned Matrix for instant queries with range-bound inners** — `execute(&str)` is the trait surface for `/api/v1/query` only, and PromQL instant queries with a `metric[10s]` inner always return Vector (one value per series computed over `[t-range, t]`). The `any_range_candidate` signal captured the inner range, not the outer eval shape, and produced a Matrix that the Prometheus adapter's `format_success_response` rejects with a 500 / empty body. Hard-wired the `execute(&str)` site to pass `false`; left the parameter on the helper for the future `handle_range_query_promql` wire-up. Test 6 also pivoted: `top_endpoint_qps` is name-classified as TopK by the planner (always heap-bearing), so the original heap-less wire setup couldn't match. Switched to heap-bearing msgpack wire (same shape as Test 9) and a `count_over_time(...)` query — cross- coverage with Test 9's `topk(...)` on the same underlying sid. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consumes PR #265's
count_over_time → FrequencyEstimatewiring end-to-end. Tests 6 + 7 promote from soft-check (assertstatusfield exists) to strict-success (assertstatus == \"success\"+ non-empty result vector). Two underlying engine bugs surfaced and were fixed.Engine fixes
build_count_min_exporthardcoded wirerows/colsto 0The policy_fp content match keys on
parameters.{d, w}against the DP's wire dimensions. Hardcoding 0 made every heap-less CMS sid register withpolicy_fp = UNSET(unreachable throughsids_for_policy). Same bug Tests 8+9 hit before PR #258 addedwire_rows/wire_colsto the heap-bearing helpers. Nowbuild_count_min_exportmirrors that shape.execute(&str)returned Matrix for instant queries with range-bound innersasap_tier_result_to_query_result(.., is_range_query=true)was driven byany_range_candidate— but that signal captures the inner range (metric[10s]), not the outer eval shape.execute(&str)is the trait surface for/api/v1/query(instant) only — PromQL instant queries with range inners always return Vector (one value per series, computed over[t-range, t]). Returning Matrix made the Prometheus adapter'sformat_success_response500 with an empty body. Hard-wired theexecute(&str)site to passfalse; left the parameter on the helper for the futurehandle_range_query_promqlwire-up.Test pivots
topk(5, endpoint_request_freq)(soft-check) tocount_over_time(endpoint_request_freq[10s])(strict-success). Wire dimensions extracted from planner's(w, d).top_endpoint_qpsis name-classified as TopK so the planner always emitsCountSketchWithHeap. Switched wire to heap-bearing msgpack (mirror of Test 9) + querycount_over_time(...)— cross-coverage with Test 9'stopk(...)on the same sid.Test plan
cargo test --test e2e_controller_plans_and_backend_serves— all 9 pass with strict success on Tests 6+7cargo test --workspace --lib— 1533 pass, 0 fail🤖 Generated with Claude Code