Support cancelable SPDY executor stream

Mark remotecommand.Executor as deprecated and related modifications.

Handle crash when streamer.stream panics

Add a test to verify if stream is closed after connection being closed

Remove blank line and update waiting time to 1s to avoid test flakes in CI.

Refine the tests of StreamExecutor according to comments.

Remove the comment of context controlling the negotiation progress and misc.

Signed-off-by: arkbriar <arkbriar@gmail.com>
This commit is contained in:
arkbriar
2022-08-24 10:21:35 +08:00
parent 575031b68f
commit 42808c8343
7 changed files with 166 additions and 24 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
package streaming
import (
"context"
"crypto/tls"
"io"
"net/http"
@@ -355,7 +356,7 @@ func runRemoteCommandTest(t *testing.T, commandType string) {
Stderr: stderrW,
Tty: false,
}
require.NoError(t, exec.Stream(opts))
require.NoError(t, exec.StreamWithContext(context.Background(), opts))
}()
go func() {