Skip to content

Commit 35d6959

Browse files
authored
Merge pull request kubernetes#129586 from soltysh/expand_error_conditions
e2e: expand error conditions when test-ing port-forward
2 parents 5e220e4 + f886f3b commit 35d6959

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/e2e/kubectl/portforward.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,12 @@ var _ = SIGDescribe("Kubectl Port forwarding", func() {
612612
ginkgo.By("Check the client error")
613613
gomega.Expect(err).To(gomega.HaveOccurred())
614614
gomega.Expect(err.Error()).To(gomega.Or(
615-
gomega.ContainSubstring("connection reset by peer"),
616-
gomega.ContainSubstring("EOF"),
617-
gomega.ContainSubstring("context deadline exceeded")))
615+
// these two errors indicates remote connection is closed
616+
gomega.ContainSubstring("connection reset by peer"), gomega.ContainSubstring("EOF"),
617+
// this error indicates timeout when POST-ing data
618+
gomega.ContainSubstring("context deadline exceeded"),
619+
// this will happen when trying to write to a closed connection
620+
gomega.ContainSubstring("write: broken pipe")))
618621

619622
ginkgo.By("Check kubectl port-forward exit code")
620623
gomega.Expect(cmd.cmd.ProcessState.ExitCode()).To(gomega.BeNumerically("<", 0), "kubectl port-forward should finish with non-zero exit code")

0 commit comments

Comments
 (0)