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>
This commit is contained in:
Julien Pivotto 2025-12-03 14:20:00 +01:00
parent 1a853e23db
commit 4620c8ac71

View file

@ -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}