Skip to content

test(e2e)+fix(engine): Tests 6+7 strict-success via count_over_time - #266

Merged
zzylol merged 1 commit into
mainfrom
tests-6-7-strict-success-count-over-time
May 16, 2026
Merged

zzylol merged 1 commit into
mainfrom
tests-6-7-strict-success-count-over-time

Conversation

@zzylol

@zzylol zzylol commented May 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Consumes PR #265's count_over_time → FrequencyEstimate wiring end-to-end. Tests 6 + 7 promote from soft-check (assert status field exists) to strict-success (assert status == \"success\" + non-empty result vector). Two underlying engine bugs surfaced and were fixed.

Engine fixes

build_count_min_export hardcoded wire rows/cols to 0

The policy_fp content match keys on parameters.{d, w} against the DP's wire dimensions. Hardcoding 0 made every heap-less CMS sid register with policy_fp = UNSET (unreachable through sids_for_policy). Same bug Tests 8+9 hit before PR #258 added wire_rows/wire_cols to the heap-bearing helpers. Now build_count_min_export mirrors that shape.

execute(&str) returned Matrix for instant queries with range-bound inners

asap_tier_result_to_query_result(.., is_range_query=true) was driven by any_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's format_success_response 500 with an 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 pivots

  • Test 7 (CMS heap-less): query changed from topk(5, endpoint_request_freq) (soft-check) to count_over_time(endpoint_request_freq[10s]) (strict-success). Wire dimensions extracted from planner's (w, d).
  • Test 6 (CountSketch): top_endpoint_qps is name-classified as TopK so the planner always emits CountSketchWithHeap. Switched wire to heap-bearing msgpack (mirror of Test 9) + query count_over_time(...) — cross-coverage with Test 9's topk(...) on the same sid.

Test plan

  • cargo test --test e2e_controller_plans_and_backend_serves — all 9 pass with strict success on Tests 6+7
  • cargo test --workspace --lib — 1533 pass, 0 fail

🤖 Generated with Claude Code

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>
@zzylol
zzylol merged commit e2497d3 into main May 16, 2026
@zzylol
zzylol deleted the tests-6-7-strict-success-count-over-time branch July 17, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant