Kotlin/Native iOS test freezes on get request with error: NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9807)
See original GitHub issueHey!
I’m using ktor in my multiplatform application. I have problem with testing ktor client get request to any page. It totally freezes. Other tests work. (Same test on Android works well)
My test looks like this:
@Test
fun downloadPageContent() {
runBlocking(Dispatchers.Unconfined) {
HttpClient().use {
it.get<String>("https://stackowerflow.com")
}
}
}
My run ios test gradle script:
task iosTest {
description = "Runs tests for target 'ios' on an iOS simulator"
def device = project.findProperty("iosDevice")?.toString() ?: "iPhone 8"
dependsOn 'linkTestDebugExecutableIos'
group = JavaBasePlugin.VERIFICATION_GROUP
doLast {
def binary = kotlin.targets.ios.compilations.test.getBinary('EXECUTABLE', 'DEBUG')
exec {
commandLine 'xcrun', 'simctl', 'spawn', device, binary.absolutePath
}
}
}
Versions:
ktor_version = '1.1.1'
coroutines_version = '1.1.0'
kotlin_version = '1.3.11'
PS: If i change url to random characters error no longer prints, but it still freezes.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Kotlin/Native iOS test freezes on get request with error
Kotlin/Native iOS test freezes on get request with error: NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9807).
Read more >Kotlin/Native iOS test freezes on get request with error
Kotlin/Native iOS test freezes on get request with error: NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9807)
Read more >Native: Empty runBlocking(MainDispatcher) {} freezes main ...
Kotlin/Native iOS test freezes on get request with error: NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9807) ...
Read more >NSURLSession HTTP load failed (kCFStreamErrorDomainSSL
On this thread: NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813) iOS I have found out I should add this code in ...
Read more >kCFStreamErrorDomainSSL Error -9802 - Apple Developer
I can't seem to find what this error means. ... NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@e5l I can’t just use
launch
in tests. They will just pass then.I’ve also got that:
runBlocking
without passing any Dispatcher.GlobalScope.launch(MainDispatcher) { client.get(..) }
I will try do the same withrunBlocking
when figure out this: https://github.com/Kotlin/kotlinx.coroutines/issues/952Fixed by KTOR-2683.