Skip to content

Commit

Permalink
promql: cleanup: use errors.As (prometheus#7351)
Browse files Browse the repository at this point in the history
This was TODO because circleci was not in go1.13 yet.

Signed-off-by: Julien Pivotto <[email protected]>
  • Loading branch information
roidelapluie authored Jun 5, 2020
1 parent 6ff4814 commit 4284dd1
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions promql/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"io/ioutil"
"os"
"sort"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -117,9 +116,7 @@ func TestQueryTimeout(t *testing.T) {
testutil.NotOk(t, res.Err, "expected timeout error but got none")

var e ErrQueryTimeout
// TODO: when circleci-windows moves to go 1.13:
// testutil.Assert(t, errors.As(res.Err, &e), "expected timeout error but got: %s", res.Err)
testutil.Assert(t, strings.HasPrefix(res.Err.Error(), e.Error()), "expected timeout error but got: %s", res.Err)
testutil.Assert(t, errors.As(res.Err, &e), "expected timeout error but got: %s", res.Err)
}

const errQueryCanceled = ErrQueryCanceled("test statement execution")
Expand Down Expand Up @@ -499,9 +496,7 @@ func TestEngineShutdown(t *testing.T) {
testutil.NotOk(t, res2.Err, "expected error on querying with canceled context but got none")

var e ErrQueryCanceled
// TODO: when circleci-windows moves to go 1.13:
// testutil.Assert(t, errors.As(res2.Err, &e), "expected cancellation error but got: %s", res2.Err)
testutil.Assert(t, strings.HasPrefix(res2.Err.Error(), e.Error()), "expected cancellation error but got: %s", res2.Err)
testutil.Assert(t, errors.As(res2.Err, &e), "expected cancellation error but got: %s", res2.Err)
}

func TestEngineEvalStmtTimestamps(t *testing.T) {
Expand Down

0 comments on commit 4284dd1

Please sign in to comment.