Skip to content

Commit 47b4fc5

Browse files
Tests: mitigate progressivity issue in LegacyHTTPClientTests (#7011)
The legacy client can block several threads by semaphore and the test case itself blocks a thread per request. The test case waits until all requests go in the middle of the process, but some of requests won't be started due to a lack of available threads on a machine with a few cores. Reducing the number of concurrent requests does not solve the root issue (it ultimately requires lock/wait free implementation and I think it's not worth it just for legacy one), but should be enough to repair CI.
1 parent 15e77b0 commit 47b4fc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Tests/BasicsTests/LegacyHTTPClientTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ final class LegacyHTTPClientTests: XCTestCase {
596596
let observability = ObservabilitySystem.makeForTesting()
597597
let cancellator = Cancellator(observabilityScope: observability.topScope)
598598

599-
let total = 10
599+
let total = min(10, ProcessInfo.processInfo.activeProcessorCount / 2)
600600
// this DispatchGroup is used to wait for the requests to start before calling cancel
601601
let startGroup = DispatchGroup()
602602
// this DispatchGroup is used to park the delayed threads that would be cancelled

0 commit comments

Comments
 (0)