Skip to content

test: scaletest/reconnectingpty: use TerminalReader #15079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Oct 16, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test: scaletest/reconnectingpty: use TerminalReader
  • Loading branch information
mtojek committed Oct 15, 2024
commit a474ffddc2d1cbeff35c428139804c76c7b50bb6
11 changes: 6 additions & 5 deletions scaletest/reconnectingpty/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (

func Test_Runner(t *testing.T) {
t.Parallel()
t.Skip("https://github.com/coder/internal/issues/98")

t.Run("OK", func(t *testing.T) {
t.Parallel()
Expand All @@ -43,14 +42,16 @@ func Test_Runner(t *testing.T) {

logs := bytes.NewBuffer(nil)
err := runner.Run(ctx, "1", logs)
logStr := logs.String()
t.Log("Runner logs:\n\n" + logStr)
require.NoError(t, err)

require.Contains(t, logStr, "Output:")
tr := testutil.NewTerminalReader(t, logs)
err = tr.ReadUntilString(ctx, "Output:")
require.NoError(t, err)

// OSX: Output:\n\thello world\n
// Win: Output:\n\t\x1b[2J\x1b[m\x1b[H\x1b]0;Administrator: C:\\Program Files\\PowerShell\\7\\pwsh.exe\a\x1b[?25hhello world\n
require.Contains(t, logStr, "hello world\n")
err = tr.ReadUntilString(ctx, "hello world")
require.NoError(t, err)
})

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