-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix tests dying because of SIGPIPE #1099
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
Conversation
@swift-ci please test |
Looks good to me. |
@@ -46,6 +48,8 @@ class TestURLSession : XCTestCase { | |||
|
|||
override class func setUp() { | |||
super.setUp() | |||
|
|||
_ = signal(SIGPIPE, SIG_IGN) |
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.
we might want to add this earlier in the lifecycle (e.g. main.swift) so that it applies equally to all tests (perhaps we might add more in the future that will need this
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.
@phausler agreed, good idea! Will update.
@phausler updated |
@swift-ci please test |
(`POSIX` sends `SIGPIPE` when writing to a closed fd)
@swift-ci please test |
1 similar comment
@swift-ci please test |
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.
looks good to me
was there a specific situation where a closed fd was being written to or is it just to cover potential future issues? |
@spevans there was a test that was failing because of that, I think |
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.
LGTM
@swift-ci please test and merge |
@swift-ci test and merge |
(POSIX sends
SIGPIPE
when writing to a closed fd which will then kill your project unless you ignore it or handle it properly)