Root cause
The test uses withTimeout(1000) (1 second) which is too tight for CI environments under load. The test server startup + HTTP request + response reading can exceed 1 second on loaded CI agents.
Affected tests:
DarwinEngineTest.testRequestInRunBlockingDispatchersDefault[macosArm64]
DarwinLegacyEngineTest.testRequestInRunBlocking[macosArm64]
Observed behavior
Tests pass locally but fail intermittently on TeamCity macOS Arm64 agents with:
kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 1000 ms
Suggested fix
Increase the withTimeout value from 1000ms to a more generous value (e.g., 5000ms or 10000ms) to account for CI agent load variance.
Files:
ktor-client/ktor-client-darwin/darwin/test/DarwinEngineTest.kt
ktor-client/ktor-client-darwin-legacy/darwin/test/DarwinLegacyEngineTest.kt
Observed in PR #5465 and on release/3.x base branch (build 412668).
Root cause
The test uses
withTimeout(1000)(1 second) which is too tight for CI environments under load. The test server startup + HTTP request + response reading can exceed 1 second on loaded CI agents.Affected tests:
DarwinEngineTest.testRequestInRunBlockingDispatchersDefault[macosArm64]DarwinLegacyEngineTest.testRequestInRunBlocking[macosArm64]Observed behavior
Tests pass locally but fail intermittently on TeamCity macOS Arm64 agents with:
Suggested fix
Increase the
withTimeoutvalue from 1000ms to a more generous value (e.g., 5000ms or 10000ms) to account for CI agent load variance.Files:
ktor-client/ktor-client-darwin/darwin/test/DarwinEngineTest.ktktor-client/ktor-client-darwin-legacy/darwin/test/DarwinLegacyEngineTest.ktObserved in PR #5465 and on
release/3.xbase branch (build 412668).