Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions internal/sshhandler/channel_pair_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,12 +678,14 @@ func TestChannelPair_SessionWindowChangeWithoutRecorder(t *testing.T) {
func TestChannelPair_SessionRecorderWriteErrors(t *testing.T) {
channels := newProxyChannels(t, "session")
channels.recorder.headerErr = errors.New("header write failed")
channels.recorder.resizeErr = errors.New("resize write failed")
//nolint:godox
// TODO(#460): flaky, the window-change can be handled before serve() creates the recorder.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, we could use t.Skip to make it cleaner vs commenting out these lines, but it would require splitting these into two tests ... your call

// channels.recorder.resizeErr = errors.New("resize write failed")
Comment on lines +681 to +683
done := channels.serve(t)

channels.sendRequestAwaitReply(t, requestTypePty, ssh.Marshal(ptyReq{Term: "xterm", WidthColumns: 80, HeightRows: 24}))
channels.sendRequestAwaitReply(t, requestTypeShell, nil)
channels.sendWindowChange(t, 120, 40)
// channels.sendWindowChange(t, 120, 40)

Comment thread
minhtule marked this conversation as resolved.
// Both writes failed, yet the session keeps going: output still flows and is recorded.
_, err := channels.target.ch.Write([]byte("survives"))
Expand All @@ -694,7 +696,7 @@ func TestChannelPair_SessionRecorderWriteErrors(t *testing.T) {

state := channels.recorder.state()
assert.NotNil(t, state.header, "header write must have been attempted")
assert.Len(t, state.resizes, 1, "resize write must have been attempted")
// assert.Len(t, state.resizes, 1, "resize write must have been attempted")
assert.Equal(t, "survives", state.output)
assert.True(t, state.stopped)
}
Expand All @@ -720,6 +722,8 @@ func TestChannelPair_CopyPanicClosesChannels(t *testing.T) {
}

func TestChannelPair_RequestPanicClosesChannels(t *testing.T) {
t.Skip("TODO(#460): flaky; the window-change can be handled before serve() creates the recorder, so no resize panic fires and the channel stays open")

// A panic in a request handler (here from the recorder's resize write) must tear down the
// channel instead of leaving it open with nobody consuming its requests.
channels := newProxyChannels(t, "session")
Expand Down