Skip to content

Commit

Permalink
tests/riot.go close body after evaluating statusCode
Browse files Browse the repository at this point in the history
  • Loading branch information
suizman committed Dec 12, 2018
1 parent cd0c49c commit 1670123
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/riot.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ func Attacker(goRoutineId int, c *Config, f func(j int, c *Config) ([]byte, erro
if err != nil {
log.Fatalf("Unable to perform request: %v", err)
}
res.Body.Close()

if res.StatusCode != c.req.expectedStatusCode {
log.Fatalf("Server error: %v", res)
Expand All @@ -118,7 +117,7 @@ func Attacker(goRoutineId int, c *Config, f func(j int, c *Config) ([]byte, erro
c.counter++

io.Copy(ioutil.Discard, res.Body)

res.Body.Close()
time.Sleep(c.delay_ms * time.Millisecond)
}
c.counter = 0
Expand Down

0 comments on commit 1670123

Please sign in to comment.