Skip to content

Commit

Permalink
Add ReadTimeout for e2e tests, otherwise this can hang forever.
Browse files Browse the repository at this point in the history
  • Loading branch information
markmandel committed Sep 20, 2018
1 parent 0ecca13 commit 4b6aa88
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/e2e/framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ func PingGameServer(msg, address string) (reply string, err error) {
return "", errors.Wrapf(err, "Could not write message %s", msg)
}
b := make([]byte, 1024)

err = conn.SetReadDeadline(time.Now().Add(30 * time.Second))
if err != nil {
return "", err
}
n, err := conn.Read(b)
if err != nil {
return "", err
Expand Down

0 comments on commit 4b6aa88

Please sign in to comment.