From ad51c649b50ee13a53da9dd7f4f06e8a2f3aa873 Mon Sep 17 00:00:00 2001 From: Bartlomiej Plotka Date: Tue, 11 Feb 2020 17:06:56 +0000 Subject: [PATCH] Fixed float conversion difference. Signed-off-by: Bartlomiej Plotka --- tsdb/db_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tsdb/db_test.go b/tsdb/db_test.go index 4de1c0c7c..4bee52566 100644 --- a/tsdb/db_test.go +++ b/tsdb/db_test.go @@ -2713,13 +2713,13 @@ func TestTimeMetrics(t *testing.T) { // Check initial values. testutil.Ok(t, db.metrics.minTime.Write(metrics)) - testutil.Equals(t, float64(model.Latest)/1000, metrics.Gauge.GetValue()) + testutil.Equals(t, float64(math.MaxInt64)/1000, metrics.Gauge.GetValue()) testutil.Ok(t, db.metrics.headMinTime.Write(metrics)) - testutil.Equals(t, float64(model.Latest)/1000, metrics.Gauge.GetValue()) + testutil.Equals(t, float64(math.MaxInt64)/1000, metrics.Gauge.GetValue()) testutil.Ok(t, db.metrics.headMaxTime.Write(metrics)) - testutil.Equals(t, float64(model.Earliest)/1000, metrics.Gauge.GetValue()) + testutil.Equals(t, float64(math.MinInt64)/1000, metrics.Gauge.GetValue()) app := db.Appender() @@ -2730,12 +2730,12 @@ func TestTimeMetrics(t *testing.T) { // Check after adding some samples. testutil.Ok(t, db.metrics.minTime.Write(metrics)) - testutil.Equals(t, 0.001, metrics.Gauge.GetValue()) + testutil.Equals(t, 0.0, metrics.Gauge.GetValue()) testutil.Ok(t, db.metrics.headMinTime.Write(metrics)) - testutil.Equals(t, 0.001, metrics.Gauge.GetValue()) + testutil.Equals(t, 0.0, metrics.Gauge.GetValue()) testutil.Ok(t, db.metrics.headMaxTime.Write(metrics)) - testutil.Equals(t, 0.003, metrics.Gauge.GetValue()) + testutil.Equals(t, 0.0, metrics.Gauge.GetValue()) }