Skip to content

Commit

Permalink
moare
Browse files Browse the repository at this point in the history
  • Loading branch information
dprotaso committed Mar 19, 2023
1 parent 296ce46 commit d31d65b
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,8 @@ func RuntimeRequestWithExpectations(ctx context.Context, t *testing.T, client *h
opt(req)
}

id := rand.Int()
req.Header.Set("id", strconv.Itoa(id))
resp, err := client.Do(req)

if err != nil {
Expand All @@ -1141,7 +1143,7 @@ func RuntimeRequestWithExpectations(ctx context.Context, t *testing.T, client *h

for _, e := range responseExpectations {
if err := e(resp); err != nil {
t.Error("Error meeting response expectations:", err)
t.Errorf("[%d] Error meeting response expectations: %v", id, err)
DumpResponse(ctx, t, resp)
return nil
}
Expand All @@ -1150,7 +1152,7 @@ func RuntimeRequestWithExpectations(ctx context.Context, t *testing.T, client *h
if resp.StatusCode == http.StatusOK {
b, err := io.ReadAll(resp.Body)
if err != nil {
t.Error("Unable to read response body:", err)
t.Errorf("[%d] Unable to read response body: %v", id, err)
DumpResponse(ctx, t, resp)
return nil
}
Expand All @@ -1159,7 +1161,7 @@ func RuntimeRequestWithExpectations(ctx context.Context, t *testing.T, client *h
t.Error("Unable to parse runtime image's response payload:", err)
return nil
}
return ri
return &ri
}
return nil
}
Expand Down

0 comments on commit d31d65b

Please sign in to comment.