From 4620c8ac71842a15fc9d74d52017c3e012b5bd80 Mon Sep 17 00:00:00 2001 From: Julien Pivotto <291750+roidelapluie@users.noreply.github.com> Date: Wed, 3 Dec 2025 14:20:00 +0100 Subject: [PATCH] Simplify StartTime assignment in unit test setup. Remove redundant IsZero check since promqltest.LazyLoader already handles zero StartTime by defaulting to Unix epoch. Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com> --- cmd/promtool/unittest.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmd/promtool/unittest.go b/cmd/promtool/unittest.go index 75da96c2eb..14557793c5 100644 --- a/cmd/promtool/unittest.go +++ b/cmd/promtool/unittest.go @@ -232,11 +232,7 @@ func (tg *testGroup) test(testname string, evalInterval time.Duration, groupOrde } // Setup testing suite. // Set the start time from the test group. - if tg.StartTimestamp.IsZero() { - queryOpts.StartTime = time.Unix(0, 0).UTC() - } else { - queryOpts.StartTime = tg.StartTimestamp.Time - } + queryOpts.StartTime = tg.StartTimestamp.Time suite, err := promqltest.NewLazyLoader(tg.seriesLoadingString(), queryOpts) if err != nil { return []error{err}