Skip to content

Commit 84b8cf4

Browse files
committed
test: construct both cadence queries through workload planning
1 parent f865488 commit 84b8cf4

1 file changed

Lines changed: 11 additions & 25 deletions

File tree

‎control_plane/src/physical/compiler.rs‎

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7060,40 +7060,26 @@ pub(crate) mod tests {
70607060
interval: RepetitionInterval(45_000),
70617061
evaluation_phase: planner_types::workload::TimestampMs(0),
70627062
};
7063-
let mut right = snapshot.clone();
7064-
right.query_workload.repeating_queries.as_mut().unwrap()[0].query =
7065-
Query("sum_over_time(n[1m])".into());
7066-
let (mut request, env) = snapshot.into_physical_compilation_request().unwrap();
7067-
let (right, _) = right.into_physical_compilation_request().unwrap();
7068-
// These are independent query outputs. Adding an approximate quantile
7069-
// to an exact sum would require a separate composed accuracy proof.
7070-
let mut raw_query = right.queries[0].clone();
7071-
raw_query.query_id = "raw-query".into();
7072-
request.queries.push(raw_query);
7073-
request
7063+
// Keep both outputs independent: composing a quantile with a sum would
7064+
// require an additional accuracy proof unrelated to cadence selection.
7065+
let mut raw_entry = entry.clone();
7066+
raw_entry.query = Query("sum_over_time(n[1m])".into());
7067+
snapshot
70747068
.query_workload
7075-
.as_mut()
7076-
.unwrap()
70777069
.repeating_queries
70787070
.as_mut()
70797071
.unwrap()
7080-
.push(
7081-
right
7082-
.query_workload
7083-
.unwrap()
7084-
.repeating_queries
7085-
.unwrap()
7086-
.remove(0),
7087-
);
7088-
prepare_window_implementations(&mut request.queries[0], &model, env.target, 0).unwrap();
7089-
request.queries[0]
7090-
.window_realization_candidates
7091-
.retain(|candidate| {
7072+
.push(raw_entry);
7073+
let (mut request, env) = snapshot.into_physical_compilation_request().unwrap();
7074+
for query in &mut request.queries {
7075+
prepare_window_implementations(query, &model, env.target, 0).unwrap();
7076+
query.window_realization_candidates.retain(|candidate| {
70927077
matches!(
70937078
candidate.layout,
70947079
asap_types::WindowMaterializationLayout::Pane { .. }
70957080
)
70967081
});
7082+
}
70977083
let plan = DeploymentPlanCompiler.compile_promql(request, env).unwrap();
70987084
assert!(plan
70997085
.precompute_plan

0 commit comments

Comments
 (0)