fix: Agent/SessionTTY flake waiting for terminal prompt (#1002)

For an unknown reason, the prompt wouldn't appear on Windows
randomly in CI. This shouldn't be a necessary check anyways,
because terminal input will be buffered.
This commit is contained in:
Kyle Carberry
2022-04-14 15:55:43 +00:00
committed by GitHub
parent fed02cdcdc
commit 3304db08dd
-3
View File
@@ -63,11 +63,9 @@ func TestAgent(t *testing.T) {
t.Run("SessionTTY", func(t *testing.T) {
t.Parallel()
session := setupSSHSession(t)
prompt := "$"
command := "bash"
if runtime.GOOS == "windows" {
command = "cmd.exe"
prompt = ">"
}
err := session.RequestPty("xterm", 128, 128, ssh.TerminalModes{})
require.NoError(t, err)
@@ -78,7 +76,6 @@ func TestAgent(t *testing.T) {
session.Stdin = ptty.Input()
err = session.Start(command)
require.NoError(t, err)
ptty.ExpectMatch(prompt)
ptty.WriteLine("echo test")
ptty.ExpectMatch("test")
ptty.WriteLine("exit")