Skip to content

Commit 94629bf

Browse files
committed
fix integration test
Signed-off-by: Ben Ye <[email protected]>
1 parent 491c4c6 commit 94629bf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

integration/e2ecortex/client.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ func (c *Client) RemoteRead(matchers []*labels.Matcher, start, end time.Time, st
167167
Start: startMs,
168168
End: endMs,
169169
})
170+
if err != nil {
171+
return nil, err
172+
}
170173

171174
req := &prompb.ReadRequest{
172175
Queries: []*prompb.Query{q},
@@ -183,7 +186,8 @@ func (c *Client) RemoteRead(matchers []*labels.Matcher, start, end time.Time, st
183186
httpReqCtx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
184187
defer cancel()
185188

186-
httpReq, err := http.NewRequestWithContext(httpReqCtx, "POST", "http://"+c.querierAddress+"/prometheus/api/v1/read", bytes.NewReader(compressed))
189+
var httpReq *http.Request
190+
httpReq, err = http.NewRequestWithContext(httpReqCtx, "POST", "http://"+c.querierAddress+"/prometheus/api/v1/read", bytes.NewReader(compressed))
187191
httpReq.Header.Set("X-Scope-OrgID", "user-1")
188192
httpReq.Header.Add("Content-Encoding", "snappy")
189193
httpReq.Header.Add("Accept-Encoding", "snappy")

0 commit comments

Comments
 (0)