Update port forward e2e for go 1.6

Only close the stdout/stderr pipes from kubectl port-forward when we're truly done with the command,
instead of as soon as runPortForward exits.

Also try to gracefully stop kubectl port-forward via SIGINT, instead of always sending SIGKILL, as
this will help avoid spdy goroutine leaks in the Kubelet.
This commit is contained in:
Andy Goldstein
2016-03-24 14:56:27 -04:00
parent 4a6e6b3fbf
commit 66899a47a5
2 changed files with 61 additions and 20 deletions

View File

@@ -511,11 +511,11 @@ var _ = KubeDescribe("Kubectl client", func() {
It("should support port-forward", func() {
By("forwarding the container port to a local port")
cmd, listenPort := runPortForward(ns, simplePodName, simplePodPort)
defer tryKill(cmd)
cmd := runPortForward(ns, simplePodName, simplePodPort)
defer cmd.Stop()
By("curling local port output")
localAddr := fmt.Sprintf("http://localhost:%d", listenPort)
localAddr := fmt.Sprintf("http://localhost:%d", cmd.port)
body, err := curl(localAddr)
Logf("got: %s", body)
if err != nil {