Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d11a431

Browse files
committed
bug: Add test that breaks ptytest on Intel Mac
1 parent 992b583 commit d11a431

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pty/ptytest/ptytest_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package ptytest_test
22

33
import (
4+
"os/exec"
45
"testing"
56

7+
"github.com/stretchr/testify/require"
8+
69
"github.com/coder/coder/pty/ptytest"
710
)
811

@@ -15,4 +18,13 @@ func TestPtytest(t *testing.T) {
1518
pty.ExpectMatch("write")
1619
pty.WriteLine("read")
1720
})
21+
// nolint:paralleltest
22+
t.Run("Do not hang on Intel macOS", func(t *testing.T) {
23+
cmd := exec.Command("sh", "-c", "for i in $(seq 1 1000); do echo $i; done")
24+
pty := ptytest.New(t)
25+
cmd.Stdin = pty.Input()
26+
cmd.Stdout = pty.Output()
27+
err := cmd.Run()
28+
require.NoError(t, err)
29+
})
1830
}

0 commit comments

Comments
 (0)