swift-server / swift-server/async-http-client
flaky test: `testConnectionPoolGrowsToMaxConcurrentConnections`
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 1.1k
- Forks
- 156
- PR merge metrics
- No merged PRs in 30d
Description
There are a couple of issues with testConnectionPoolGrowsToMaxConcurrentConnections:
-
The
maxConnectionsvariable isn't passed down to theConnectionPoolconstructor. 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 > maxConnectionsis also valid. TheConnectionsCountHandlerdoesn'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).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with testConnectionPoolGrowsToMaxConcurrentConnections in Tests/AsyncHTTPClientTests/HTTPConnectionPoolTests.swift and inspect ConnectionsCountHandler in Tests/AsyncHTTPClientTests/HTTPClientTestUtils.swift. Run the test and verify it passes a non-default maxConnections value, measures the maximum concurrent connections rather than only total connections created, and accepts valid connection recreation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100