Skip to content
Closed
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
8 changes: 4 additions & 4 deletions internal/exec/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,14 @@ func TestPseudoConsolePowershell(t *testing.T) {
}()

cmd := "echo \"howdy from conpty\"\r\n"
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.

Small nit, can we make "howdy from conpty" a const and use that on line 201 and format it into this string?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure!

if _, err := cpty.InPipe().Write([]byte(cmd)); err != nil {
if _, err := cpty.Write([]byte(cmd)); err != nil {
t.Fatal(err)
}

// If after five seconds we haven't read the output we wrote to the pseudo console below then
// If after the timeout we haven't read the output we wrote to the pseudo console below then
// fail the test.
select {
case <-time.After(time.Second * 5):
case <-time.After(time.Second * 10):
t.Fatal("timed out waiting for output to pseudo console")
case err := <-errChan:
if err != nil {
Expand All @@ -223,7 +223,7 @@ func TestPseudoConsolePowershell(t *testing.T) {
}

exit := "exit\r\n"
if _, err := cpty.InPipe().Write([]byte(exit)); err != nil {
if _, err := cpty.Write([]byte(exit)); err != nil {
t.Fatal(err)
}

Expand Down