Skip to content

Commit 4c7ebd2

Browse files
committed
fix: Increase ptytest buffer to resolve flake
From investigating the following run: https://github.com/coder/coder/runs/6156348454?check_suite_focus=true It's believed that the cause is data being discarded due to the buffer filling up. This _might_ fix it, but not entirely sure.
1 parent 5575e3c commit 4c7ebd2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

agent/agent_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ func TestAgent(t *testing.T) {
7676
session.Stdin = ptty.Input()
7777
err = session.Start(command)
7878
require.NoError(t, err)
79+
caret := "$"
80+
if runtime.GOOS == "windows" {
81+
caret = ">"
82+
}
83+
ptty.ExpectMatch(caret)
7984
ptty.WriteLine("echo test")
8085
ptty.ExpectMatch("test")
8186
ptty.WriteLine("exit")

pty/ptytest/ptytest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func create(t *testing.T, ptty pty.PTY) *PTY {
6060
PTY: ptty,
6161

6262
outputWriter: writer,
63-
runeReader: bufio.NewReaderSize(ptty.Output(), utf8.UTFMax),
63+
runeReader: bufio.NewReaderSize(ptty.Output(), 4096),
6464
}
6565
}
6666

0 commit comments

Comments
 (0)