❯ go test ./pty/ptytest -v -run=TestPtytest/Do_not_hang -timeout=5s === RUN TestPtytest === PAUSE TestPtytest === CONT TestPtytest === RUN TestPtytest/Do_not_hang_on_Intel_macOS panic: test timed out after 5s goroutine 18 [running]: testing.(*M).startAlarm.func1() /usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:2029 +0x8e created by time.goFunc /usr/local/Cellar/go/1.18/libexec/src/time/sleep.go:176 +0x32 goroutine 1 [chan receive]: testing.tRunner.func1() /usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:1405 +0x4a5 testing.tRunner(0xc0001111e0, 0xc00013fcd8) /usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:1445 +0x13b testing.runTests(0xc000119220?, {0x132cc80, 0x1, 0x1}, {0x1500108?, 0x40?, 0x1337780?}) /usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:1837 +0x457 testing.(*M).Run(0xc000119220) /usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:1719 +0x5d9 main.main() _testmain.go:49 +0x1aa goroutine 6 [chan receive]: testing.(*T).Run(0xc000111380, {0x11de169?, 0x6287be95?}, 0x11eb620) /usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:1487 +0x37a github.com/coder/coder/pty/ptytest_test.TestPtytest(0x0?) /Users/maf/Work/Code/coder/pty/ptytest/ptytest_test.go:22 +0x58 testing.tRunner(0xc000111380, 0x11eb628) /usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:1439 +0x102 created by testing.(*T).Run /usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:1486 +0x35f goroutine 7 [chan receive]: os/exec.(*Cmd).Wait(0xc0001506e0) /usr/local/Cellar/go/1.18/libexec/src/os/exec/exec.go:515 +0x188 os/exec.(*Cmd).Run(0x11bc5e0?) /usr/local/Cellar/go/1.18/libexec/src/os/exec/exec.go:341 +0x39 github.com/coder/coder/pty/ptytest_test.TestPtytest.func2(0x0?) /Users/maf/Work/Code/coder/pty/ptytest/ptytest_test.go:27 +0x145 testing.tRunner(0xc0001116c0, 0x11eb620) /usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:1439 +0x102 created by testing.(*T).Run /usr/local/Cellar/go/1.18/libexec/src/testing/testing.go:1486 +0x35f goroutine 8 [select]: io.(*pipe).read(0xc000012540, {0xc00008e000, 0x1000, 0x1231c01?}) /usr/local/Cellar/go/1.18/libexec/src/io/pipe.go:57 +0xb1 io.(*PipeReader).Read(0x3?, {0xc00008e000?, 0xc0001116c0?, 0xc00007d680?}) /usr/local/Cellar/go/1.18/libexec/src/io/pipe.go:136 +0x25 bufio.(*Scanner).Scan(0xc000168100) /usr/local/Cellar/go/1.18/libexec/src/bufio/scan.go:215 +0x865 github.com/coder/coder/pty/ptytest.create.func2() /Users/maf/Work/Code/coder/pty/ptytest/ptytest.go:49 +0x93 created by github.com/coder/coder/pty/ptytest.create /Users/maf/Work/Code/coder/pty/ptytest/ptytest.go:48 +0x25f goroutine 9 [IO wait]: internal/poll.runtime_pollWait(0x1763a18, 0x72) /usr/local/Cellar/go/1.18/libexec/src/runtime/netpoll.go:302 +0x89 internal/poll.(*pollDesc).wait(0xc0000124e0?, 0xc000094000?, 0x1) /usr/local/Cellar/go/1.18/libexec/src/internal/poll/fd_poll_runtime.go:83 +0x32 internal/poll.(*pollDesc).waitRead(...) /usr/local/Cellar/go/1.18/libexec/src/internal/poll/fd_poll_runtime.go:88 internal/poll.(*FD).Read(0xc0000124e0, {0xc000094000, 0x8000, 0x8000}) /usr/local/Cellar/go/1.18/libexec/src/internal/poll/fd_unix.go:167 +0x25a os.(*File).read(...) /usr/local/Cellar/go/1.18/libexec/src/os/file_posix.go:31 os.(*File).Read(0xc0000100b0, {0xc000094000?, 0x119e840?, 0xc000092001?}) /usr/local/Cellar/go/1.18/libexec/src/os/file.go:119 +0x5e github.com/coder/coder/pty.ReadWriter.Read(...) /Users/maf/Work/Code/coder/pty/pty.go:55 io.copyBuffer({0x121adc0, 0xc000092000}, {0x121ac40, 0xc00005b2f0}, {0x0, 0x0, 0x0}) /usr/local/Cellar/go/1.18/libexec/src/io/io.go:426 +0x1b2 io.Copy(...) /usr/local/Cellar/go/1.18/libexec/src/io/io.go:385 os.genericReadFrom(0x11d2740?, {0x121ac40, 0xc00005b2f0}) /usr/local/Cellar/go/1.18/libexec/src/os/file.go:162 +0x67 os.(*File).ReadFrom(0x0?, {0x121ac40?, 0xc00005b2f0?}) /usr/local/Cellar/go/1.18/libexec/src/os/file.go:156 +0x55 io.copyBuffer({0x121a8e0, 0xc0000100d8}, {0x121ac40, 0xc00005b2f0}, {0x0, 0x0, 0x0}) /usr/local/Cellar/go/1.18/libexec/src/io/io.go:412 +0x14b io.Copy(...) /usr/local/Cellar/go/1.18/libexec/src/io/io.go:385 os/exec.(*Cmd).stdin.func1() /usr/local/Cellar/go/1.18/libexec/src/os/exec/exec.go:266 +0x45 os/exec.(*Cmd).Start.func1(0x0?) /usr/local/Cellar/go/1.18/libexec/src/os/exec/exec.go:441 +0x25 created by os/exec.(*Cmd).Start /usr/local/Cellar/go/1.18/libexec/src/os/exec/exec.go:440 +0x715 FAIL github.com/coder/coder/pty/ptytest 5.146s FAIL