-
Notifications
You must be signed in to change notification settings - Fork 618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add support for writing to ptys #3591
base: main
Are you sure you want to change the base?
Conversation
Failure is unrelated. |
defer pty.Close() | ||
defer tty.Close() | ||
|
||
for _, writer := range gc.ptyWriters { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we use errgroup to wait for the routines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes indeed.
Will update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverting to draft for the time being - being abroad I may not have time to look into this immediately.
Thanks @AkihiroSuda .
Signed-off-by: apostasie <[email protected]>
}() | ||
} | ||
|
||
defer func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defer func() { | |
defer func() { | |
// Best effort. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this may help when debugging issues ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @fahedouch
this is not ready though - I left it half assed a little while back, but will get it proper soon!
@@ -105,8 +107,18 @@ func (gc *GenericCommand) Run(expect *Expected) { | |||
iCmdCmd.Stdin = tty | |||
iCmdCmd.Stdout = tty | |||
iCmdCmd.Stderr = tty | |||
defer pty.Close() | |||
defer tty.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't move defer tty.Close()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not mandatory but you can just defer closing the tty before the goroutines loop
This is the next step in removing
unbuffer
from our testing, adding the ability to write to stdin with ptys.