Skip to content

Commit fe9e760

Browse files
committed
test: extra debug output for flaky failure case
1 parent 40caed5 commit fe9e760

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/internal/itest/http_fetch_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,11 @@ func TestHttpFetch(t *testing.T) {
997997
if testCase.expectFail {
998998
req.Equal(http.StatusGatewayTimeout, resp.StatusCode)
999999
} else {
1000-
req.Equal(http.StatusOK, resp.StatusCode)
1000+
if resp.StatusCode != http.StatusOK {
1001+
body, err := io.ReadAll(resp.Body)
1002+
req.NoError(err)
1003+
req.Failf("200 response code not received", "got code: %d, body: %s", resp.StatusCode, string(body))
1004+
}
10011005
req.Equal(fmt.Sprintf(`attachment; filename="%s.car"`, srcData[i].Root.String()), resp.Header.Get("Content-Disposition"))
10021006
req.Equal("none", resp.Header.Get("Accept-Ranges"))
10031007
req.Equal("public, max-age=29030400, immutable", resp.Header.Get("Cache-Control"))

0 commit comments

Comments
 (0)