Skip to content

Commit

Permalink
Fix TestCommand_SetWinsize
Browse files Browse the repository at this point in the history
  • Loading branch information
adambabik committed Oct 27, 2024
1 parent ae87ef3 commit b571b10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/cmd/beta/session_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func executeDefaultShellProgram(
return nil, err
}

err = program.Wait()
err = program.Wait(ctx)
if err != nil {
return nil, err
}
Expand Down
6 changes: 4 additions & 2 deletions internal/command/command_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"

Expand Down Expand Up @@ -338,6 +339,7 @@ func TestCommand_SetWinsize(t *testing.T) {
},
Interactive: true,
Mode: runnerv2.CommandMode_COMMAND_MODE_INLINE,
Env: []string{"TERM=xterm"},
},
CommandOptions{Stdout: stdout},
)
Expand All @@ -348,8 +350,8 @@ func TestCommand_SetWinsize(t *testing.T) {
err = SetWinsize(cmd, &Winsize{Rows: 45, Cols: 56, X: 0, Y: 0})
require.NoError(t, err)
err = cmd.Wait(context.Background())
require.NoError(t, err)
require.Equal(t, "56\r\n45\r\n", stdout.String())
assert.NoError(t, err)
assert.Equal(t, "56\r\n45\r\n", stdout.String())
})

t.Run("Terminal", func(t *testing.T) {
Expand Down

0 comments on commit b571b10

Please sign in to comment.