Size: a a a

Kotlin Community

2019 November 18

PL

Patrick Lemke in Kotlin Community
kotlin.IllegalStateException: There is no event loop. Use runBlocking { ... } to start one. Does anyone know where this error is coming from? I've got some coroutine code that works fine on the JVM, but on macosX64 I get this error.
источник

PL

Patrick Lemke in Kotlin Community
This code is in a Test Class. It looks something like this:

@Test
fun testCancelNullTask() = runBlocking(Dispatchers.Default) {
   
val task = Task.createNullTask()
   delay(100)
   task.cancel()
   assertNull(task.result)
   assertFalse(task.cancelled)
}
источник

PL

Patrick Lemke in Kotlin Community
All the tests fail with the same message
источник

IS

Ihar Sadounikau in Kotlin Community
Есть ли какие-нибудь варианты параметризированного тестирования на котлине?
Что-то вроде Spock для Kotlin
источник

AM

Andrew Mikhaylov in Kotlin Community
Patrick Lemke
kotlin.IllegalStateException: There is no event loop. Use runBlocking { ... } to start one. Does anyone know where this error is coming from? I've got some coroutine code that works fine on the JVM, but on macosX64 I get this error.
Generally speaking, threading is quite different on K/JVM and K/N. R
Current release version of kotlinx.coroutines doesn't support multithreading for K/N at all, but this is soon to be changed. Still, K/N adds limitations to what you can do, so I'd suggest reading through the docs.

https://kotlinlang.org/docs/reference/native/concurrency.html

Here's how it would work when kotlinx.coroutines is released (no ETA yet): https://github.com/Kotlin/kotlinx.coroutines/blob/native-mt/kotlin-native-sharing.md
источник

VP

Vladimir Petrakovich in Kotlin Community
Ihar Sadounikau
Есть ли какие-нибудь варианты параметризированного тестирования на котлине?
Что-то вроде Spock для Kotlin
Есть Spek
источник

PL

Patrick Lemke in Kotlin Community
Andrew Mikhaylov
Generally speaking, threading is quite different on K/JVM and K/N. R
Current release version of kotlinx.coroutines doesn't support multithreading for K/N at all, but this is soon to be changed. Still, K/N adds limitations to what you can do, so I'd suggest reading through the docs.

https://kotlinlang.org/docs/reference/native/concurrency.html

Here's how it would work when kotlinx.coroutines is released (no ETA yet): https://github.com/Kotlin/kotlinx.coroutines/blob/native-mt/kotlin-native-sharing.md
Thanks I will have a look
источник

AM

Andrew Mikhaylov in Kotlin Community
Patrick Lemke
Thanks I will have a look
If your test don't involve any multithreading, just asynchrony, try to go for runBlocking without parameter. That's also just a wild guess as I didn't touch K/N for a long time unfortunately.
источник

RI

Ruslan Ibragimov in Kotlin Community
Ihar Sadounikau
Есть ли какие-нибудь варианты параметризированного тестирования на котлине?
Что-то вроде Spock для Kotlin
я просто вот так использую, но можно поверх pair, triple, etc накрутить покрасивее синтаксис
источник

IS

Ihar Sadounikau in Kotlin Community
@frostbit @HeapyHop спасибо, многообещающе выглядит 🙂
источник

PL

Patrick Lemke in Kotlin Community
Andrew Mikhaylov
If your test don't involve any multithreading, just asynchrony, try to go for runBlocking without parameter. That's also just a wild guess as I didn't touch K/N for a long time unfortunately.
Well at least now I get different errors 🤷‍♂️
источник

AM

Andrew Mikhaylov in Kotlin Community
Patrick Lemke
Well at least now I get different errors 🤷‍♂️
I'm hoping they are looking more actionable :)
источник

PL

Patrick Lemke in Kotlin Community
Andrew Mikhaylov
I'm hoping they are looking more actionable :)
Now I've got some weird gradle errors
источник

ch

central hardware in Kotlin Community
источник

AM

Andrew Mikhaylov in Kotlin Community
источник

PL

Patrick Lemke in Kotlin Community
источник

PL

Patrick Lemke in Kotlin Community
No clue what gradle wants from me haha
источник

LS

Leonid Startsev in Kotlin Community
it seems that the test process quit unexpectedly. run test.kexe from build folder manually, likely it will segfault
источник

LS

Leonid Startsev in Kotlin Community
and report another issue to tracker, please 🙂
источник

PL

Patrick Lemke in Kotlin Community
Leonid Startsev
and report another issue to tracker, please 🙂
Sure 😊
источник