@@ -1847,11 +1847,29 @@ final class HTTPClientTests: XCTestCaseHTTPClientTestsBaseClass {
18471847 }
18481848
18491849 func testPoolClosesIdleConnections( ) {
1850+ let configuration = HTTPClient . Configuration (
1851+ certificateVerification: . none,
1852+ maximumAllowedIdleTimeInConnectionPool: . milliseconds( 100 )
1853+ )
1854+
18501855 let localClient = HTTPClient ( eventLoopGroupProvider: . shared( self . clientGroup) ,
1851- configuration: . init ( connectionPool : . init ( idleTimeout : . milliseconds ( 100 ) ) ) )
1856+ configuration: configuration )
18521857 defer {
18531858 XCTAssertNoThrow ( try localClient. syncShutdown ( ) )
18541859 }
1860+
1861+ // Make sure that the idle timeout of the connection pool is properly propagated
1862+ // to the connection pool itself, when using both inits.
1863+ XCTAssertEqual ( configuration. connectionPool. idleTimeout, . milliseconds( 100 ) )
1864+ XCTAssertEqual (
1865+ configuration. connectionPool. idleTimeout,
1866+ HTTPClient . Configuration (
1867+ certificateVerification: . none,
1868+ connectionPool: . milliseconds( 100 ) ,
1869+ backgroundActivityLogger: nil
1870+ ) . connectionPool. idleTimeout
1871+ )
1872+
18551873 XCTAssertNoThrow ( try localClient. get ( url: self . defaultHTTPBinURLPrefix + " get " ) . wait ( ) )
18561874 Thread . sleep ( forTimeInterval: 0.2 )
18571875 XCTAssertEqual ( self . defaultHTTPBin. activeConnections, 0 )
0 commit comments