@@ -6,7 +6,6 @@ package integration
6
6
import (
7
7
"crypto/x509"
8
8
"crypto/x509/pkix"
9
- "encoding/json"
10
9
"fmt"
11
10
"os"
12
11
"path/filepath"
@@ -15,6 +14,7 @@ import (
15
14
"testing"
16
15
"time"
17
16
17
+ v1 "github.com/prometheus/client_golang/api/prometheus/v1"
18
18
"github.com/prometheus/common/model"
19
19
"github.com/prometheus/prometheus/model/labels"
20
20
"github.com/prometheus/prometheus/prompb"
@@ -354,16 +354,9 @@ func runQueryFrontendTest(t *testing.T, cfg queryFrontendTestConfig) {
354
354
_ , err := c .QueryRange ("up)" , start , end , time .Second )
355
355
require .Error (t , err )
356
356
357
- // Expect the error response format to be correct.
358
- type response struct {
359
- Status string `json:"status"`
360
- ErrorType string `json:"errorType,omitempty"`
361
- Error string `json:"error,omitempty"`
362
- }
363
- var res response
364
- err = json .Unmarshal ([]byte (err .Error ()), & res )
365
- require .NoError (t , err )
366
- require .Equal (t , res .ErrorType , "bad_data" )
357
+ apiErr , ok := err .(* v1.Error )
358
+ require .True (t , ok )
359
+ require .Equal (t , apiErr .Type , v1 .ErrBadData )
367
360
}
368
361
369
362
for q := 0 ; q < numQueriesPerUser ; q ++ {
0 commit comments