diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go index 336e3b47ef..92ffb3f15f 100644 --- a/test/e2e/play_kube_test.go +++ b/test/e2e/play_kube_test.go @@ -1689,12 +1689,15 @@ func testHTTPServer(port string, shouldErr bool, expectedResponse string) { Expect(string(body)).Should(Equal(expectedResponse)) } -func testEchoServer(connection io.ReadWriter) { +func testEchoServer(connection net.Conn) { stringToSend := "hello world" var err error var bytesSent int + interval := 250 * time.Millisecond - for i := 0; i < 6; i++ { + for i := 0; i < 5; i++ { + err = connection.SetDeadline(time.Now().Add(time.Second)) + Expect(err).To(BeNil()) bytesSent, err = fmt.Fprint(connection, stringToSend) if err == nil { break @@ -1708,7 +1711,9 @@ func testEchoServer(connection io.ReadWriter) { stringReceived := make([]byte, bytesSent) var bytesRead int interval = 250 * time.Millisecond - for i := 0; i < 6; i++ { + for i := 0; i < 5; i++ { + err = connection.SetDeadline(time.Now().Add(time.Second)) + Expect(err).To(BeNil()) bytesRead, err = bufio.NewReader(connection).Read(stringReceived) if err == nil { break