-
Notifications
You must be signed in to change notification settings - Fork 123
fix test faling with NIOTS #257
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 test faling with NIOTS #257
Conversation
@@ -797,7 +797,7 @@ class HTTPClientInternalTests: XCTestCase { | |||
} | |||
|
|||
func testUncleanCloseThrows() { | |||
let server = NIOHTTP1TestServer(group: self.clientGroup) | |||
let server = NIOHTTP1TestServer(group: MultiThreadedEventLoopGroup(numberOfThreads: 1)) |
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.
who shuts this MTELG down?
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.
I think we have self.serverGroup
which could be used
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.
oooops, no one, good catch, thank you! no, we don't have that in internal tests class
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.
and its only monday... 😔
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.
oooops, no one, good catch, thank you! no, we don't have that in internal tests class
We should. I was probably lazy and changed only all of the non-internal tests
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.
so far we won't be using it anywhere else in that class (it usually just creates HTTPBin
), still worth it?
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.
@artemredkin I think we should have a defaultHTTPBin
and defaultClient
and client/serverGroup
all set up in setUp
/tearDown
. That makes tests more concise and therefore better
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.
but we don't need to do it right in this PR, up to you
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.
awesome, thkna
Fixes test crashing on precondition.
Motivation:
When tests are executed on macOS client ELG is actually a
NIOTS
ELG, so it's incompatible withNIOHTTP1TestServer
Modifications:
Use separate ELG in
testUncleanCloseThrows
Result:
Closes #256