@@ -907,6 +907,11 @@ load 1ms
907
907
for ts := int64 (- 1000000 + 1000 ); ts <= 0 ; ts += 1000 {
908
908
require .NoError (t , app .AddFast (ref , ts , - float64 (ts / 1000 )+ 1 ))
909
909
}
910
+
911
+ // To test the fix for https://github.com/prometheus/prometheus/issues/8433.
912
+ _ , err = app .Add (labels .FromStrings ("__name__" , "metric_timestamp" ), 3600 * 1000 , 1000 )
913
+ require .NoError (t , err )
914
+
910
915
require .NoError (t , app .Commit ())
911
916
912
917
cases := []struct {
@@ -1033,6 +1038,26 @@ load 1ms
1033
1038
Metric : lblstopk2 ,
1034
1039
},
1035
1040
},
1041
+ }, {
1042
+ // Tests for https://github.com/prometheus/prometheus/issues/8433.
1043
+ // The trick here is that the query range should be > lookback delta.
1044
+ query : `timestamp(metric_timestamp @ 3600)` ,
1045
+ start : 0 , end : 7 * 60 , interval : 60 ,
1046
+ result : Matrix {
1047
+ Series {
1048
+ Points : []Point {
1049
+ {V : 3600 , T : 0 },
1050
+ {V : 3600 , T : 60 * 1000 },
1051
+ {V : 3600 , T : 2 * 60 * 1000 },
1052
+ {V : 3600 , T : 3 * 60 * 1000 },
1053
+ {V : 3600 , T : 4 * 60 * 1000 },
1054
+ {V : 3600 , T : 5 * 60 * 1000 },
1055
+ {V : 3600 , T : 6 * 60 * 1000 },
1056
+ {V : 3600 , T : 7 * 60 * 1000 },
1057
+ },
1058
+ Metric : labels.Labels {},
1059
+ },
1060
+ },
1036
1061
},
1037
1062
}
1038
1063
@@ -1061,6 +1086,7 @@ load 1ms
1061
1086
})
1062
1087
}
1063
1088
}
1089
+
1064
1090
func TestRecoverEvaluatorRuntime (t * testing.T ) {
1065
1091
ev := & evaluator {logger : log .NewNopLogger ()}
1066
1092
@@ -2124,3 +2150,8 @@ func TestEngineOptsValidation(t *testing.T) {
2124
2150
}
2125
2151
}
2126
2152
}
2153
+
2154
+ // TestFuncTimestampWithAtModifier tests for https://github.com/prometheus/prometheus/issues/8433.
2155
+ func TestFuncTimestampWithAtModifier (t * testing.T ) {
2156
+
2157
+ }
0 commit comments