From f886f3b7f10912713d6511838844b81474e2daf5 Mon Sep 17 00:00:00 2001 From: Maciej Szulik Date: Mon, 13 Jan 2025 11:15:26 +0100 Subject: [PATCH] e2e: expand error conditions when test-ing port-forward Signed-off-by: Maciej Szulik --- test/e2e/kubectl/portforward.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/e2e/kubectl/portforward.go b/test/e2e/kubectl/portforward.go index cf267d73a80..5ca2382223e 100644 --- a/test/e2e/kubectl/portforward.go +++ b/test/e2e/kubectl/portforward.go @@ -612,9 +612,12 @@ var _ = SIGDescribe("Kubectl Port forwarding", func() { ginkgo.By("Check the client error") gomega.Expect(err).To(gomega.HaveOccurred()) gomega.Expect(err.Error()).To(gomega.Or( - gomega.ContainSubstring("connection reset by peer"), - gomega.ContainSubstring("EOF"), - gomega.ContainSubstring("context deadline exceeded"))) + // these two errors indicates remote connection is closed + gomega.ContainSubstring("connection reset by peer"), gomega.ContainSubstring("EOF"), + // this error indicates timeout when POST-ing data + gomega.ContainSubstring("context deadline exceeded"), + // this will happen when trying to write to a closed connection + gomega.ContainSubstring("write: broken pipe"))) ginkgo.By("Check kubectl port-forward exit code") gomega.Expect(cmd.cmd.ProcessState.ExitCode()).To(gomega.BeNumerically("<", 0), "kubectl port-forward should finish with non-zero exit code")