Change:
this is you
Hmm, I had upped waiting from 100ms to 500ms and that seemed to fix it. Do you have any better ideas?
Don't wait? :)
If the only reason you would timeout would be the code is broken, that's why the test runs have -timeout set.
Then the test fails immediately. It's waiting for the net.Listen calls to finish so it can connect to the specified local ports.
*finish enough so that socket connections work
So I can remove the timeout gating in my tests?
Yes ----- Original Message -----
Just failed again: https://travis-
Seems to be failing frequently now.
If this is test is failing again, my gut says it's not the same root cause. The original failure was a timeout issue. This new one is connection reset by peer. I've got the test running in a loop waiting for a failure but haven't seen one yet. is this still failing frequently?
No. It had failed twice in ~10 builds when I reopened this issue, but hasn't failed since. Reclosing. Will file a new issue if it recurs.

Discussion:
go func() { doneChan <- pf.ForwardPorts() }() <del> select { case <-pf.Ready: case <-time.After(500 * time.Millisecond): t.Fatalf("%d: timed out waiting for listeners", i) } </del> <ins> <-pf.Ready </ins> conn := testCase.Upgrader.conn

close(stopChan) // wait for r.ForwardPorts to actually return <del> select { case err := <-doneChan: if err != nil { t.Fatalf("%d: unexpected error: %s", err) } case <-time.After(200 * time.Millisecond): t.Fatalf("%d: timeout waiting for ForwardPorts to finish") </del> <ins> err = <-doneChan if err != nil { t.Fatalf("%d: unexpected error: %s", err) </ins> } if e, a := len(testCase.Send), len(conn.streams); e != a {

return 100 * time.Millisecond } <del> idleSuccess := make(chan struct{}) fw.fakeKubelet.execFunc = func(podFullName string, uid types.UID, containerName string, cmd []string, in io.Reader, out, stderr io.WriteCloser, tty bool) error { select { case <-idleSuccess: case <-time.After(150 * time.Millisecond): t.Fatalf("execFunc timed out waiting for idle timeout") } return nil } </del> podNamespace := "other" podName := "foo" expectedContainerName := "baz"

defer conn.Close() h := http.Header{} <del> h.Set("type", "input") </del> <ins> h.Set(api.StreamType, api.StreamTypeError) </ins> stream, err := conn.CreateStream(h) if err != nil { t.Fatalf("error creating input stream: %v", err) } defer stream.Reset() <del> select { case <-conn.CloseChan(): close(idleSuccess) case <-time.After(150 * time.Millisecond): t.Fatalf("Timed out waiting for connection closure due to idle timeout") } </del> <ins> <-conn.CloseChan() </ins> } func TestServeExecInContainer(t *testing.T) {

t.Fatalf("%d:, error writing to stdout: %v", i, err) } out.Close() <del> select { case <-clientStdoutReadDone: case <-time.After(10 * time.Millisecond): t.Fatalf("%d: timed out waiting for client to read stdout", i) } </del> <ins> <-clientStdoutReadDone </ins> } else if out != nil { t.Fatalf("%d: stdout: expected nil: %#v", i, out) }

t.Fatalf("%d:, error writing to stderr: %v", i, err) } stderr.Close() <del> select { case <-clientStderrReadDone: case <-time.After(10 * time.Millisecond): t.Fatalf("%d: timed out waiting for client to read stderr", i) } </del> <ins> <-clientStderrReadDone </ins> } else if stderr != nil { t.Fatalf("%d: stderr: expected nil: %#v", i, stderr) }

} } <del> select { case <-execFuncDone: case <-time.After(10 * time.Millisecond): t.Fatalf("%d: timed out waiting for execFunc to complete", i) } </del> <ins> <-execFuncDone </ins> } }

return 100 * time.Millisecond } <del> idleSuccess := make(chan struct{}) fw.fakeKubelet.portForwardFunc = func(name string, uid types.UID, port uint16, stream io.ReadWriteCloser) error { select { case <-idleSuccess: case <-time.After(150 * time.Millisecond): t.Fatalf("execFunc timed out waiting for idle timeout") } return nil } </del> podNamespace := "other" podName := "foo"

} defer conn.Close() <del> select { case <-conn.CloseChan(): close(idleSuccess) case <-time.After(150 * time.Millisecond): t.Fatalf("Timed out waiting for connection closure due to idle timeout") } </del> <ins> <-conn.CloseChan() </ins> } func TestServePortForward(t *testing.T) {

} } <del> select { case <-portForwardFuncDone: case <-time.After(100 * time.Millisecond): t.Fatalf("%d: timed out waiting for portForwardFuncDone", i) } </del> <ins> <-portForwardFuncDone </ins> } }