Deflake proxy unit tests.

Closes https://github.com/GoogleCloudPlatform/kubernetes/issues/795
It wasn't the source of the race.  The race was actually fixed elsewhere,
as far as I can tell.

But it was the source of the flakes as far as I can tell.

I think the basic problem is that there is no ability to flush either side
of the TCP connection independently.  You're forced to just close the whole
thing to force a flush, and that lead to situations where sometimes not all
of the data was written, and thus not all of it was echo-d, and the Read
hung forever waiting for 5 bytes.

(at least that seems to be the issue)

Empirically this PR switched it that test from being ~50% flakey on my
machine to 100% reliable over 10 runs.

--brendan


On Wed, Aug 13, 2014 at 3:49 PM, Daniel Smith <notifications@github.com>
wrote:

> In pkg/proxy/proxier_test.go:
>
> >  	if err != nil {
> > -		return "", fmt.Errorf("failed to start echo service: %v", err)
> > +		panic(fmt.Sprintf("failed to parse: %v", err))
> > +	}
> > +	_, port, err = net.SplitHostPort(u.Host)
>
> I don't mind this change, but echoServer wasn't the source of any race (as
> long people were using :0 as the port).
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/GoogleCloudPlatform/kubernetes/pull/887/files#r16211810>
> .
>