mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 05:34:05 -08:00
promql: cleanup: use errors.As (#7351)
This was TODO because circleci was not in go1.13 yet. Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
parent
6ff4814a49
commit
4284dd1f1b
|
@ -19,7 +19,6 @@ import (
|
|||
"io/ioutil"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
|
@ -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")
|
||||
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue