Skip to content

fix: Rewrite ptytest to buffer stdout #3170

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

Merged
merged 7 commits into from
Jul 25, 2022
Merged

Conversation

mafredri
Copy link
Member

With this PR we now always buffer command output.

The ExpectMatch function was also refactored a bit to avoid a race where a timeout could fire whilst writing to buffer (concurrent read/write), or a timeout could fail the test just as it succeeds.

Fixes #2122

@mafredri mafredri self-assigned this Jul 25, 2022
@mafredri mafredri requested a review from a team July 25, 2022 13:46
Copy link
Member

@kylecarbs kylecarbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Awesome change that should reduce a LOT of potential races. 😎

@mafredri mafredri merged commit 92a95fb into main Jul 25, 2022
@mafredri mafredri deleted the mafredri/ptytest-buffer-output branch July 25, 2022 17:02
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.

Tests using Cobra with ptytest can hang on macOS (and Windows) unless the output is consumed
2 participants