From 4eca3194bb430d7403744325809d15fa7e6555e7 Mon Sep 17 00:00:00 2001 From: discord9 Date: Fri, 20 Nov 2026 04:44:51 +0000 Subject: [PATCH] test(query): skip the far-future overflow test when SystemTime cannot represent it (#10545) Windows SystemTime and 32-bit time_t targets cannot represent the 5e18 ms statement start, so checked_add returns None before the planner sees the query. Skip the high-level shape there; the platform-independent native_tree_supported_declines_the_instants_that_overflow test still covers the admission predicate. Signed-off-by: discord9 --- src/query/src/promql/planner/test.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/query/src/promql/planner/test.rs b/src/query/src/promql/planner/test.rs index e876d6e06bf..1fba23601f2 100644 --- a/src/query/src/promql/planner/test.rs +++ b/src/query/src/promql/planner/test.rs @@ -3446,16 +3446,23 @@ async fn native_fused_partitioned_table_label_rewrite_falls_back() { /// route, and dropping it from the predicate makes this test fail. (The `@` half of the same /// arithmetic is pinned one level down, in `native::plan::tests`, because a statement whose anchor /// and start are that far apart is refused by the planner's own at-modifier rewrite first.) +/// +/// A platform whose `SystemTime` cannot represent the `5e18 ms` start skips the high-level +/// shape; the platform-independent `native_tree_supported_declines_the_instants_that_overflow` +/// still covers the admission predicate there. #[tokio::test] async fn native_fused_windows_whose_instants_overflow_fall_back() { - // The far end of the `i64` millisecond range, one step apart. + // The far end of the `i64` millisecond range, one step apart. Windows' `SystemTime` and + // 32-bit `time_t` targets cannot represent it, so they cannot build this statement. + let Some(far_start) = UNIX_EPOCH.checked_add(Duration::from_millis(5_000_000_000_000_000_000)) + else { + return; + }; let plan_for = |query: &str, native_fused| { let query = query.to_string(); async move { let mut eval_stmt = build_eval_stmt(&query); - eval_stmt.start = UNIX_EPOCH - .checked_add(Duration::from_millis(5_000_000_000_000_000_000)) - .unwrap(); + eval_stmt.start = far_start; eval_stmt.end = eval_stmt .start .checked_add(Duration::from_millis(10_000))