From c0ce35d2d38a206aa1b35f89e8aa07a4057eda06 Mon Sep 17 00:00:00 2001 From: Brian Brazil Date: Thu, 8 Mar 2018 16:39:46 +0000 Subject: [PATCH] Only show debug output on test failure --- promql/test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/promql/test.go b/promql/test.go index 492d39700..6bd07cf7e 100644 --- a/promql/test.go +++ b/promql/test.go @@ -385,11 +385,6 @@ func (ev *evalCmd) compareResult(result Value) error { return fmt.Errorf("received instant result on range evaluation") } - fmt.Println("vector result", len(val), ev.expr) - for _, ss := range val { - fmt.Println(" ", ss.Metric, ss.Point) - } - seen := map[uint64]bool{} for pos, v := range val { fp := v.Metric.Hash() @@ -408,6 +403,10 @@ func (ev *evalCmd) compareResult(result Value) error { } for fp, expVals := range ev.expected { if !seen[fp] { + fmt.Println("vector result", len(val), ev.expr) + for _, ss := range val { + fmt.Println(" ", ss.Metric, ss.Point) + } return fmt.Errorf("expected metric %s with %v not found", ev.metrics[fp], expVals) } }