From 89fbdb136f8fc1e7b4af07d9f81f534e4dd26f51 Mon Sep 17 00:00:00 2001 From: ZverGuy Date: Thu, 5 Nov 2026 02:32:21 +0700 Subject: [PATCH] test(observability-proxy): cover the 1970 bound of metrics times Only the upper half of the refused 1970..2262 range had a test, so the lower check could be dropped unnoticed. vmselect clamps a time before 1970 to 0, which would answer for a window other than the one asked for. Assisted-by: LLM Signed-off-by: ZverGuy --- internal/observabilityproxy/vmselect_parse_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/observabilityproxy/vmselect_parse_test.go b/internal/observabilityproxy/vmselect_parse_test.go index 6d75bbf7f..1fb23d18f 100644 --- a/internal/observabilityproxy/vmselect_parse_test.go +++ b/internal/observabilityproxy/vmselect_parse_test.go @@ -109,7 +109,9 @@ func TestVmselectReadsSecondsWithFraction(t *testing.T) { func TestParseMetricsTimeRange(t *testing.T) { // vmselect reads an RFC3339 time through time.UnixNano, which is // undefined from 2262-04-11 on. - for _, v := range []string{"9223372037", "9999999999", "2262-04-12T00:00:00Z", "9999-01-01T00:00:00Z"} { + // Before 1970 vmselect clamps to 0, which would quietly answer for a + // window other than the one asked for. + for _, v := range []string{"9223372037", "9999999999", "2262-04-12T00:00:00Z", "9999-01-01T00:00:00Z", "1969-12-31T23:59:59Z", "1969-12-31T23:59:59.999Z"} { if _, herr := parseMetricsTime("time", v); herr == nil { t.Errorf("%q accepted, want refused", v) }