mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
fix: Improve shutdown procedure of ssh, portforward, wgtunnel cmds (#3354)
* fix: Improve shutdown procedure of ssh, portforward, wgtunnel cmds We could turn it into a practice to wrap `cmd.Context()` so that we have more fine-grained control of cancellation. Sometimes in tests we may be running commands with a context that is never canceled. Related to #3221 * fix: Set ssh session stderr to stderr
This commit is contained in:
committed by
GitHub
parent
5ae19f097e
commit
83c63d4a63
@ -229,7 +229,7 @@ func TestSSH(t *testing.T) {
|
||||
pty := ptytest.New(t)
|
||||
cmd.SetIn(pty.Input())
|
||||
cmd.SetOut(pty.Output())
|
||||
cmd.SetErr(io.Discard)
|
||||
cmd.SetErr(pty.Output())
|
||||
cmdDone := tGo(t, func() {
|
||||
err := cmd.ExecuteContext(ctx)
|
||||
assert.NoError(t, err)
|
||||
@ -248,9 +248,6 @@ func TestSSH(t *testing.T) {
|
||||
|
||||
// And we're done.
|
||||
pty.WriteLine("exit")
|
||||
// Read output to prevent hang on macOS, see:
|
||||
// https://github.com/coder/coder/issues/2122
|
||||
pty.ExpectMatch("exit")
|
||||
<-cmdDone
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user