This test:
XCTAssertNoThrow(try HTTP1ConnectionProvider(key: .init(.init(url: "http://some.test")),
eventLoop: self.eventLoop,
configuration: .init(),
pool: .init(configuration: .init(),
backgroundActivityLogger: HTTPClient.loggingDisabled),
backgroundActivityLogger: HTTPClient.loggingDisabled)
.close().wait())
hangs forever (because there's 1 pending connection) which isn't right.
The connection provider (is probably wrongly) expecting that acquire will come along and decrease pending. I'd argue it a) shouldn't wait for acquire to come along b) acquire cannot actually do that right now because acquire only decreases pending IF we're .active.
That's a real race that can happen in real usage I believe.
This test:
hangs forever (because there's 1 pending connection) which isn't right.
The connection provider (is probably wrongly) expecting that
acquirewill come along and decrease pending. I'd argue it a) shouldn't wait foracquireto come along b)acquirecannot actually do that right now becauseacquireonly decreasespendingIF we're.active.That's a real race that can happen in real usage I believe.