Repository navigation
test(planner): assert the undeclared-gauge p99 outcome, not a candidate id - #801
Merged
Merged
Conversation
…ot a candidate id The joint search discards the sketch candidates of a query before composition when they cannot meet its target, so the planning error lists only the candidates that reached Stage 3. Without the non-negative declaration that is the exact plan, rejected because raw samples are not retained. The test now checks that planning fails with no valid candidate and that this rejection is reported, instead of expecting the merged-pane candidate's id in the error.
…declared gauge Through the exhaustive search, every Stage 2 candidate that keeps a DDSketch pane chain is rejected with AccuracyTargetMissed and no relative bound, so the test no longer passes if those candidates are missing or rejected for another reason. The declared-gauge test's doc no longer names the old P5-m1 id.
This was referenced Oct 21, 2026
Closed
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.
Why
Main is red.
an_undeclared_gauges_merged_ddsketch_panes_get_no_relative_bound_through_avgexpects the planning error to name the merged-pane DDSketch candidate. The joint search now discards a query's sketch candidates before composition when they cannot meet its target. After that, the error lists only the candidates that reached Stage 3:P1(RawDataNotRetained).What
The test now checks the intended outcome rather than a candidate id:
no valid candidate, so no merged-pane DDSketch candidate is accepted;P1withRawDataNotRetained(the exact plan, which needs raw samples);Stage1ToStage3Search::exhaustive()), which keeps every candidate in Stage 3, every candidate that keeps a DDSketch pane chain is rejected withAccuracyTargetMissedand no relative bound. The test therefore fails if those candidates disappear or are rejected for another reason. Candidates are found by their pane chain, not by id.Planner behavior does not change. In the declared case, the joint search selects the same merged-pane DDSketch plan that the exhaustive search (
stage_pipeline) selects, at the same cost of 21.2225 per second. Only its candidate id differs:P3-m1instead ofP5-m1.How
The test is in
crates/planner/tests/runtime_install.rs. Its assertion on"P5-m1"is replaced with assertions onno valid candidateand on theP1RawDataNotRetainedrejection, plus an exhaustive-search run that checks each merged-pane DDSketch candidate's rejection cause and reason. The declared-gauge test's doc comment no longer names the oldP5-m1id.Key code interfaces added / modified
None. Tests only.
Before this PR
cargo test --workspace --lockedon main (aceedff) fails inan_undeclared_gauges_merged_ddsketch_panes_get_no_relative_bound_through_avg.After this PR
Main's test suite passes. The declared-gauge test is unchanged: the merged-pane DDSketch plan is selected, has a relative bound ≤ 0.05, and matches the query-time reference and the exact answers.
Verification
cargo test --workspace --locked: 1815 passed, 0 failed (before the exhaustive-search assertion was added).cargo test -p asap-planner --test runtime_install --locked: 18 passed, 0 failed (with it).cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: clean.cargo fmt --all -- --check: clean.