@@ -386,7 +386,7 @@ class HTTPClientTests: XCTestCase {
386
386
func testProxyTLS( ) throws {
387
387
XCTFail ( " Disabled test as it crashes " ) ;
388
388
return
389
-
389
+
390
390
let httpBin = HTTPBin ( simulateProxy: . tls)
391
391
let httpClient = HTTPClient (
392
392
eventLoopGroupProvider: . shared( self . clientGroup) ,
@@ -1094,11 +1094,9 @@ class HTTPClientTests: XCTestCase {
1094
1094
}
1095
1095
1096
1096
func testStressGetClose( ) throws {
1097
- if #available( OSX 10 . 14 , iOS 12 . 0 , tvOS 12 . 0 , watchOS 6 . 0 , * ) {
1098
- guard !( self . clientGroup is NIOTSEventLoopGroup ) else {
1099
- XCTFail ( " Disabled test as it crashes " ) ;
1100
- return
1101
- }
1097
+ guard !isTestingNIOTS( ) else {
1098
+ XCTFail ( " Disabled test as it crashes " ) ;
1099
+ return
1102
1100
}
1103
1101
let httpBin = HTTPBin ( ssl: false )
1104
1102
let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
@@ -1673,15 +1671,29 @@ class HTTPClientTests: XCTestCase {
1673
1671
}
1674
1672
1675
1673
func testAsyncShutdown( ) {
1676
- let eventLoopGroup = MultiThreadedEventLoopGroup ( numberOfThreads: 1 )
1677
- let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( eventLoopGroup) )
1678
- let promise = eventLoopGroup. next ( ) . makePromise ( of: Void . self)
1679
- eventLoopGroup. next ( ) . execute {
1674
+ let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) )
1675
+ let promise = self . clientGroup. next ( ) . makePromise ( of: Void . self)
1676
+ self . clientGroup. next ( ) . execute {
1680
1677
httpClient. shutdown ( queue: DispatchQueue ( label: " testAsyncShutdown " ) ) { error in
1681
1678
XCTAssertNil ( error)
1682
1679
promise. succeed ( ( ) )
1683
1680
}
1684
1681
}
1685
1682
XCTAssertNoThrow ( try promise. futureResult. wait ( ) )
1686
1683
}
1684
+
1685
+
1686
+ func testCorrectEventLoopGroup( ) {
1687
+ let httpClient = HTTPClient ( eventLoopGroupProvider: . createNew)
1688
+ defer {
1689
+ XCTAssertNoThrow ( try httpClient. syncShutdown ( ) )
1690
+ }
1691
+ #if canImport(Network)
1692
+ if #available( OSX 10 . 14 , iOS 12 . 0 , tvOS 12 . 0 , watchOS 6 . 0 , * ) {
1693
+ XCTAssertTrue ( httpClient. eventLoopGroup is NIOTSEventLoopGroup )
1694
+ return
1695
+ }
1696
+ #endif
1697
+ XCTAssertTrue ( httpClient. eventLoopGroup is MultiThreadedEventLoopGroup )
1698
+ }
1687
1699
}
0 commit comments