Skip to content

Commit 99b1354

Browse files
author
Kenichi Omichi
committed
Add error handling of CloseWrite()
The e2e test "Kubectl Port forwarding With a server listening .." is failed sometimes due to the difference between expected data and received data. To receive the data, the test does CloseWrite() but it didn't have the corresponding error handling. This adds it to investigate the issue more.
1 parent aef336d commit 99b1354

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/e2e/kubectl/portforward.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,9 @@ func doTestMustConnectSendDisconnect(bindAddress string, f *framework.Framework)
321321
fmt.Fprint(conn, "abc")
322322

323323
ginkgo.By("Closing the write half of the client's connection")
324-
conn.CloseWrite()
324+
if err = conn.CloseWrite(); err != nil {
325+
framework.Failf("Couldn't close the write half of the client's connection: %v", err)
326+
}
325327

326328
ginkgo.By("Reading data from the local port")
327329
fromServer, err := ioutil.ReadAll(conn)

0 commit comments

Comments
 (0)