@@ -471,6 +471,9 @@ class HTTPClientTests: XCTestCase {
471471 }
472472
473473 func testNoContentLengthForSSLUncleanShutdown( ) throws {
474+ // NIOTS deals with ssl unclean shutdown internally
475+ guard !isTestingNIOTS( ) else { return }
476+
474477 let httpBin = HttpBinForSSLUncleanShutdown ( )
475478 let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
476479 configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -488,6 +491,9 @@ class HTTPClientTests: XCTestCase {
488491 }
489492
490493 func testNoContentLengthWithIgnoreErrorForSSLUncleanShutdown( ) throws {
494+ // NIOTS deals with ssl unclean shutdown internally
495+ guard !isTestingNIOTS( ) else { return }
496+
491497 let httpBin = HttpBinForSSLUncleanShutdown ( )
492498 let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
493499 configuration: HTTPClient . Configuration ( certificateVerification: . none, ignoreUncleanSSLShutdown: true ) )
@@ -506,6 +512,9 @@ class HTTPClientTests: XCTestCase {
506512 }
507513
508514 func testCorrectContentLengthForSSLUncleanShutdown( ) throws {
515+ // NIOTS deals with ssl unclean shutdown internally
516+ guard !isTestingNIOTS( ) else { return }
517+
509518 let httpBin = HttpBinForSSLUncleanShutdown ( )
510519 let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
511520 configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -524,6 +533,9 @@ class HTTPClientTests: XCTestCase {
524533 }
525534
526535 func testNoContentForSSLUncleanShutdown( ) throws {
536+ // NIOTS deals with ssl unclean shutdown internally
537+ guard !isTestingNIOTS( ) else { return }
538+
527539 let httpBin = HttpBinForSSLUncleanShutdown ( )
528540 let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
529541 configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -540,6 +552,9 @@ class HTTPClientTests: XCTestCase {
540552 }
541553
542554 func testNoResponseForSSLUncleanShutdown( ) throws {
555+ // NIOTS deals with ssl unclean shutdown internally
556+ guard !isTestingNIOTS( ) else { return }
557+
543558 let httpBin = HttpBinForSSLUncleanShutdown ( )
544559 let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
545560 configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -557,6 +572,9 @@ class HTTPClientTests: XCTestCase {
557572 }
558573
559574 func testNoResponseWithIgnoreErrorForSSLUncleanShutdown( ) throws {
575+ // NIOTS deals with ssl unclean shutdown internally
576+ guard !isTestingNIOTS( ) else { return }
577+
560578 let httpBin = HttpBinForSSLUncleanShutdown ( )
561579 let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
562580 configuration: HTTPClient . Configuration ( certificateVerification: . none, ignoreUncleanSSLShutdown: true ) )
@@ -574,6 +592,9 @@ class HTTPClientTests: XCTestCase {
574592 }
575593
576594 func testWrongContentLengthForSSLUncleanShutdown( ) throws {
595+ // NIOTS deals with ssl unclean shutdown internally
596+ guard !isTestingNIOTS( ) else { return }
597+
577598 let httpBin = HttpBinForSSLUncleanShutdown ( )
578599 let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
579600 configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -591,6 +612,9 @@ class HTTPClientTests: XCTestCase {
591612 }
592613
593614 func testWrongContentLengthWithIgnoreErrorForSSLUncleanShutdown( ) throws {
615+ // NIOTS deals with ssl unclean shutdown internally
616+ guard !isTestingNIOTS( ) else { return }
617+
594618 let httpBin = HttpBinForSSLUncleanShutdown ( )
595619 let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
596620 configuration: HTTPClient . Configuration ( certificateVerification: . none, ignoreUncleanSSLShutdown: true ) )
@@ -1675,18 +1699,16 @@ class HTTPClientTests: XCTestCase {
16751699 }
16761700
16771701 XCTAssertThrowsError ( try httpClient. get ( url: " http://localhost: \( port) " ) . wait ( ) ) { error in
1678- #if canImport(Network)
16791702 if isTestingNIOTS ( ) {
1680- guard let ioError = error as? NWPOSIXError , ioError. errorCode == . ECONNREFUSED else {
1703+ guard case ChannelError . connectTimeout = error else {
1704+ XCTFail ( " Unexpected error: \( error) " )
1705+ return
1706+ }
1707+ } else {
1708+ guard error is NIOConnectionError else {
16811709 XCTFail ( " Unexpected error: \( error) " )
16821710 return
16831711 }
1684- return
1685- }
1686- #endif
1687- guard error is NIOConnectionError else {
1688- XCTFail ( " Unexpected error: \( error) " )
1689- return
16901712 }
16911713 }
16921714 }
0 commit comments