@@ -459,6 +459,9 @@ class HTTPClientTests: XCTestCase {
459459 }
460460
461461 func testNoContentLengthForSSLUncleanShutdown( ) throws {
462+ // NIOTS deals with ssl unclean shutdown internally
463+ guard !isTestingNIOTS( ) else { return }
464+
462465 let httpBin = HttpBinForSSLUncleanShutdown ( )
463466 let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
464467 configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -476,6 +479,9 @@ class HTTPClientTests: XCTestCase {
476479 }
477480
478481 func testNoContentLengthWithIgnoreErrorForSSLUncleanShutdown( ) throws {
482+ // NIOTS deals with ssl unclean shutdown internally
483+ guard !isTestingNIOTS( ) else { return }
484+
479485 let httpBin = HttpBinForSSLUncleanShutdown ( )
480486 let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
481487 configuration: HTTPClient . Configuration ( certificateVerification: . none, ignoreUncleanSSLShutdown: true ) )
@@ -494,6 +500,9 @@ class HTTPClientTests: XCTestCase {
494500 }
495501
496502 func testCorrectContentLengthForSSLUncleanShutdown( ) throws {
503+ // NIOTS deals with ssl unclean shutdown internally
504+ guard !isTestingNIOTS( ) else { return }
505+
497506 let httpBin = HttpBinForSSLUncleanShutdown ( )
498507 let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
499508 configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -512,6 +521,9 @@ class HTTPClientTests: XCTestCase {
512521 }
513522
514523 func testNoContentForSSLUncleanShutdown( ) throws {
524+ // NIOTS deals with ssl unclean shutdown internally
525+ guard !isTestingNIOTS( ) else { return }
526+
515527 let httpBin = HttpBinForSSLUncleanShutdown ( )
516528 let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
517529 configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -528,6 +540,9 @@ class HTTPClientTests: XCTestCase {
528540 }
529541
530542 func testNoResponseForSSLUncleanShutdown( ) throws {
543+ // NIOTS deals with ssl unclean shutdown internally
544+ guard !isTestingNIOTS( ) else { return }
545+
531546 let httpBin = HttpBinForSSLUncleanShutdown ( )
532547 let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
533548 configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -545,6 +560,9 @@ class HTTPClientTests: XCTestCase {
545560 }
546561
547562 func testNoResponseWithIgnoreErrorForSSLUncleanShutdown( ) throws {
563+ // NIOTS deals with ssl unclean shutdown internally
564+ guard !isTestingNIOTS( ) else { return }
565+
548566 let httpBin = HttpBinForSSLUncleanShutdown ( )
549567 let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
550568 configuration: HTTPClient . Configuration ( certificateVerification: . none, ignoreUncleanSSLShutdown: true ) )
@@ -562,6 +580,9 @@ class HTTPClientTests: XCTestCase {
562580 }
563581
564582 func testWrongContentLengthForSSLUncleanShutdown( ) throws {
583+ // NIOTS deals with ssl unclean shutdown internally
584+ guard !isTestingNIOTS( ) else { return }
585+
565586 let httpBin = HttpBinForSSLUncleanShutdown ( )
566587 let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
567588 configuration: HTTPClient . Configuration ( certificateVerification: . none) )
@@ -579,6 +600,9 @@ class HTTPClientTests: XCTestCase {
579600 }
580601
581602 func testWrongContentLengthWithIgnoreErrorForSSLUncleanShutdown( ) throws {
603+ // NIOTS deals with ssl unclean shutdown internally
604+ guard !isTestingNIOTS( ) else { return }
605+
582606 let httpBin = HttpBinForSSLUncleanShutdown ( )
583607 let httpClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
584608 configuration: HTTPClient . Configuration ( certificateVerification: . none, ignoreUncleanSSLShutdown: true ) )
@@ -1663,18 +1687,16 @@ class HTTPClientTests: XCTestCase {
16631687 }
16641688
16651689 XCTAssertThrowsError ( try httpClient. get ( url: " http://localhost: \( port) " ) . wait ( ) ) { error in
1666- #if canImport(Network)
16671690 if isTestingNIOTS ( ) {
1668- guard let ioError = error as? NWPOSIXError , ioError. errorCode == . ECONNREFUSED else {
1691+ guard case ChannelError . connectTimeout = error else {
1692+ XCTFail ( " Unexpected error: \( error) " )
1693+ return
1694+ }
1695+ } else {
1696+ guard error is NIOConnectionError else {
16691697 XCTFail ( " Unexpected error: \( error) " )
16701698 return
16711699 }
1672- return
1673- }
1674- #endif
1675- guard error is NIOConnectionError else {
1676- XCTFail ( " Unexpected error: \( error) " )
1677- return
16781700 }
16791701 }
16801702 }
0 commit comments