Skip to content

Commit

Permalink
remove noise in error test to ensure payload is read before responding
Browse files Browse the repository at this point in the history
  • Loading branch information
jasdel committed Jun 14, 2019
1 parent 8db7972 commit 235e028
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions service/s3/s3manager/upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1265,16 +1265,7 @@ func (h *failPartHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}

contLenStr := r.Header.Get("Content-Length")
expectLen, err := strconv.ParseInt(contLenStr, 10, 64)
if err != nil {
h.tb.Logf("expect content-length, got %q, %v", contLenStr, err)
failRequest(w, 400, "BadRequest",
fmt.Sprintf("unable to get content-length %v", err))
return
}

io.Copy(ioutil.Discard, io.LimitReader(r.Body, expectLen/2))
io.Copy(ioutil.Discard, r.Body)

failRequest(w, 500, "InternalException",
fmt.Sprintf("mock error, partNumber %v", r.URL.Query().Get("partNumber")))
Expand Down

0 comments on commit 235e028

Please sign in to comment.