Skip to content

Prevent pipe-based FileHandle tests from hanging #2279

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 1 commit into from
May 22, 2019

Conversation

beccadax
Copy link
Contributor

@beccadax beccadax commented May 17, 2019

Writing to a pipe can block if an internal buffer fills up, and the size of the buffer varies by platform and even kernel version, which may be causing the TestFileHandle.testWritingWith*() tests to hang. Address this by writing from a background queue and imposing a timeout on the write writing to a temporary file and then reading it back.

@beccadax
Copy link
Contributor Author

@swift-ci please test

@beccadax beccadax force-pushed the pipe-dreams branch 2 times, most recently from a62ea41 to 26e8399 Compare May 17, 2019 20:52
@beccadax
Copy link
Contributor Author

Lily asked for something that didn't use expectations, so this just does the simplest possible thing: writes the data to a temporary file and reads it back.

@swift-ci please test

Writing to a pipe can block if an internal buffer fills up, and the size of the buffer varies by platform and even kernel version, which may be causing the `TestFileHandle.testWritingWith*()` tests to hang. Address this by using a temporary file instead.
@beccadax
Copy link
Contributor Author

@swift-ci please test

@beccadax beccadax marked this pull request as ready for review May 18, 2019 03:28
@beccadax beccadax requested a review from millenomi May 18, 2019 03:31
@millenomi millenomi merged commit a758053 into swiftlang:master May 22, 2019
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.

2 participants