k3s/pkg/client/unversioned/portforward
Andy Goldstein 2fae847120 Fix TestPortForward flake
TestPortForward was failing occasionally due to the way the test was
written. It created a port forwarding session, then connected a client
to the local port, attempted to send some data, attempted to receive
some data, and then tore down the port forwarding session.
Unfortunately, some times the attempt to send data from the client to
the remote would be enqueued but not processed by the time the test tore
down everything. As a result, the data stream could get closed before
the client's data was transmitted to the server. If this happened, you'd
see an error such as 'forward 2 ports with bidirectional data: server
expected to receive "ghij", got "" for port 6000'.

This fixes the test by serializing the data flow: the client writes to
the remote, the remote waits to receive that data, the remote writes to
the client, and the client waits to receive the data from the remote.
This all takes place prior to the test tearing down port forwarding.
2015-11-24 15:38:11 -05:00
..
doc.go Moving client libs to unversioned dir 2015-08-18 10:03:19 -07:00
portforward.go Move port forward protocol constant to subpackage 2015-10-21 22:37:26 -04:00
portforward_test.go Fix TestPortForward flake 2015-11-24 15:38:11 -05:00