Skip to content
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

fix: MacOS PTY flake when reading after command exists #410

Merged
merged 1 commit into from
Mar 8, 2022
Merged

Conversation

kylecarbs
Copy link
Member

@kylecarbs kylecarbs commented Mar 8, 2022

The TTY wasn't buffering properly because the FD was closed.
I did this initially to clone how creack/pty handles it, but it's
unnecessary because we get the entire PTY back to close.

I tested this on my Mac by adding a time.Sleep between spawning a command and reading its output, and the io.EOF occurred every time.

The TTY wasn't bufferring properly because the FD was closed.
I did this initially to clone how creack/pty handles it, but it's
unnecessary because we get the entire PTY back to close.
@kylecarbs kylecarbs self-assigned this Mar 8, 2022
@codecov
Copy link

codecov bot commented Mar 8, 2022

Codecov Report

Merging #410 (3ce8bf1) into main (ca768e7) will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #410      +/-   ##
==========================================
+ Coverage   68.23%   68.26%   +0.02%     
==========================================
  Files         158      158              
  Lines        9228     9225       -3     
  Branches       73       73              
==========================================
  Hits         6297     6297              
+ Misses       2307     2304       -3     
  Partials      624      624              
Flag Coverage Δ
unittest-go-macos-latest 62.65% <ø> (-0.01%) ⬇️
unittest-go-ubuntu-latest 67.57% <ø> (+0.23%) ⬆️
unittest-go-windows-2022 62.16% <ø> (-0.11%) ⬇️
unittest-js 66.02% <ø> (ø)
Impacted Files Coverage Δ
pty/start_other.go 68.18% <ø> (-3.82%) ⬇️
pty/pty_other.go 76.92% <0.00%> (-7.70%) ⬇️
provisionersdk/transport.go 78.72% <0.00%> (-6.39%) ⬇️
provisionerd/provisionerd.go 78.67% <0.00%> (ø)
peer/conn.go 81.32% <0.00%> (+2.30%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca768e7...3ce8bf1. Read the comment docs.

@kylecarbs kylecarbs merged commit 6caceac into main Mar 8, 2022
@kylecarbs kylecarbs deleted the fixmactty branch March 8, 2022 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants