Skip to content

test(promql): cover nested temporal anchors and topk ordering #771

Closed

Description

@milindsrivastava1997

Goal

Extend PromQL differential coverage for two semantics that the current 90-query nested-aggregation suite intentionally normalizes away or does not exercise.

Scope

  1. Add an opt-in order-sensitive comparison mode for instant-vector responses in promql-compliance/runner.

    • Keep the default comparison order-insensitive for general vectors and matrices.
    • Use the mode for an instant topk case so ASAPQuery is compared against Prometheus in returned descending-value order.
    • Assert full-label-set ordering for equal values.
    • Do not require one global ordering for /query_range matrices.
  2. Add nested aggregation cases with temporal inner anchors, each exercised through both /query and /query_range:

    • e.g. topk(3, sum by (job) (rate(data[5m])))
    • at least one reducer after a temporal anchor, such as avg(sum by (job) (rate(data[5m]))).

Rationale

The existing 90-query suite uses bare data selectors and normalizes result samples by labels before comparison. It verifies result membership and values, but cannot detect TopK presentation-order regressions and does not cover a range selector consumed by a temporal function before the nested aggregation pipeline.

Acceptance criteria

  • A direct Prometheus-vs-ASAPQuery instant TopK order check passes.
  • The existing default differential comparisons remain order-insensitive.
  • Nested temporal-anchor queries pass against Prometheus for both instant and range endpoints.
  • The suite continues to verify range-at-t / instant-at-t parity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions