Description
There are a couple of issues with testConnectionPoolGrowsToMaxConcurrentConnections
:
-
The
maxConnections
variable isn't passed down to theConnectionPool
constructor. The expected value 8 happens to match the default, but shouldn't this test use a non-default value, to check that the parameter works? -
It checks:
XCTAssertEqual(httpBin.createdConnections, maxConnections)
But actually,
httpBin.createdConnections > maxConnections
is also valid. TheConnectionsCountHandler
doesn't actually measure the maximum number of active connections it saw -- just the total number that were created. If I have a couple of Xcode projects open, some Safari windows each with lots of tabs, I can see 10 created connections (even though when logging, I see that the maximum concurrent connections parameter was always respected).