-
Notifications
You must be signed in to change notification settings - Fork 123
Support NIO Transport Services - part 2 #184
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
Can one of the admins verify this patch? |
2 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Here's a list of all the failing tests. Some of them fail both with TS and without. With Transport Services
Without
|
fyi Set Environment variable "ENABLE_TS_TESTS" to "true" to test NIOTS. |
let group = MultiThreadedEventLoopGroup(numberOfThreads: 4) | ||
let group = getDefaultEventLoopGroup(numberOfThreads: 4) | ||
defer { | ||
XCTAssertNoThrow(try group.syncShutdownGracefully()) |
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.
shouldn't this be executed by the tests teardown?
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.
In this case the eventLoopGroup has been created inside the test because it required a different number of threads
14a3a63
to
e57d8bb
Compare
55e3c18
to
c090008
Compare
Added NWTLSError, NWDNSError and NWPOSIXError to wrap Network.framework errors. The reason to do this was to make it easier to read Errors thrown from the Network.framework. Added NWError tests
Added macOS 10.14 fallbacks for min/max TLS protocol Enabled applicationProtocols code, now uses `String.withCString`
Removed setting option `waitForActivity` to false If running with a proxy don't setup NIOTSClientTLSProvider While running NIOTS ignore SSL unclean shutdown tests
@swift-server-bot test this please |
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.
Thank you! This looks like a great start, I left some comments regarding some potential issues.
Sources/AsyncHTTPClient/NIOTransportServices/NWErrorHandler.swift
Outdated
Show resolved
Hide resolved
Sources/AsyncHTTPClient/NIOTransportServices/NWErrorHandler.swift
Outdated
Show resolved
Hide resolved
Also don't need to create a tlsConfiguration if there is a proxy so moved its initialisation down a bit
|
||
/// Are we testing NIO Transport services | ||
func isTestingNIOTS() -> Bool { | ||
return ProcessInfo.processInfo.environment["ENABLE_TS_TESTS"] == "true" |
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.
@adam-fowler one last question: Could we flip the default here and have the tests run on TS by default? Otherwise I'm sure nobody will ever run them :|
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.
Done
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, thank you so much!!!
@swift-server-bot add to whitelist |
hit #175 |
retrying |
@swift-server-bot test this please |
@adam-fowler I think the already opened PR #192 should fix #175 while also making the code simpler |
This is the continuation of the good work of @Yasumoto and @weissi in #135
The following code adds support for NIO Transport services. When the
ConnectionPool
asks for a connection bootstrap it is returned aNIOClientTCPBootstrap
which wraps either aNIOTSConnectionBootstrap
or aClientBootstrap
depending on whether the EventLoop we are running on isNIOTSEventLoop
.If you initialize an
HTTPClient
witheventLoopGroupProvider
set to.createNew
then if you are running on iOS, macOS 10.14 or later it will provide aNIOTSEventLoopGroup
instead of aEventLoopGroup
.Currently a number of tests are failing. 4 of these are related to the NIOSSLUncleanShutdown error the others all seem related to various race conditions which are being dealt with on other PRs. I have tested this code with aws-sdk-swift and it is working on both macOS and iOS.
Things look into: