You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm very sorry about the lack of details, but I have failing the unit tests in one of the internal class related to the kotlin coroutines.
When testing the production code that heavy rely on the coroutines (many launch and delay inside), the unit test is sometimes failing. It is not fully reproducible, as it happens only when executing ./gradlew clean check command. When I run the check command (without the clean) again then everything is passing without an issue. What's more weird, not the same test is failing after clean.
The top of the callstack with the exception looks like below:
kotlin.ClassCastException: kotlinx.coroutines.internal.Removed cannot be cast to kotlinx.coroutines.internal.LockFreeLinkedListNode
at kotlin.Throwable#<init>(/Users/teamcity3/buildAgent/work/c3a91df21e46e2c8/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/Throwable.kt:24)
at kotlin.Exception#<init>(/Users/teamcity3/buildAgent/work/c3a91df21e46e2c8/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt:23)
at kotlin.RuntimeException#<init>(/Users/teamcity3/buildAgent/work/c3a91df21e46e2c8/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt:34)
at kotlin.ClassCastException#<init>(/Users/teamcity3/buildAgent/work/c3a91df21e46e2c8/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt:106)
at <global>.ThrowClassCastException(/Users/teamcity3/buildAgent/work/c3a91df21e46e2c8/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/RuntimeUtils.kt:31)
at kotlinx.coroutines.internal#unwrap__at__kotlin.Any(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/concurrent/src/internal/LockFreeLinkedList.kt:668)
at kotlinx.coroutines.JobSupport.notifyCancelling#internal(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/JobSupport.kt:332)
at kotlinx.coroutines.JobSupport.tryMakeCancelling#internal(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/JobSupport.kt:810)
at kotlinx.coroutines.JobSupport.makeCancelling#internal(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/JobSupport.kt:766)
at kotlinx.coroutines.JobSupport#cancelImpl(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/JobSupport.kt:682)
at kotlinx.coroutines.JobSupport#cancelCoroutine(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/JobSupport.kt:669)
at kotlinx.coroutines.TimeoutCoroutine.run#internal(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/Timeout.kt:159)
at kotlinx.coroutines.test.TestDispatcher#processEvent(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-test/common/src/TestDispatcher.kt:28)
at kotlinx.coroutines.test.TestCoroutineScheduler.tryRunNextTask#internal(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-test/common/src/TestCoroutineScheduler.kt:95)
at kotlinx.coroutines.test.TestCoroutineScheduler#advanceUntilIdle(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-test/common/src/TestCoroutineScheduler.kt:110)
at kotlinx.coroutines.test.$runTestCoroutineCOROUTINE$202#invokeSuspend(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-test/common/src/TestBuilders.kt:212)
at kotlinx.coroutines.test#runTestCoroutine(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-test/common/src/TestBuilders.kt:198)
at kotlinx.coroutines.test.$runTest$<anonymous>_3COROUTINE$203.invokeSuspend#internal(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-test/common/src/TestBuilders.kt:167)
at kotlinx.coroutines.test.$runTest$<anonymous>_3COROUTINE$203.invoke#internal(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-test/common/src/TestBuilders.kt:166)
at kotlinx.coroutines.test.$createTestResult$lambda-0COROUTINE$208.invokeSuspend#internal(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-test/native/src/TestBuilders.kt:13)
at kotlin.coroutines.native.internal.BaseContinuationImpl#resumeWith(/Users/teamcity3/buildAgent/work/c3a91df21e46e2c8/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/coroutines/ContinuationImpl.kt:30)
at kotlinx.coroutines.DispatchedTask#run(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/internal/DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoopImplBase#processNextEvent(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/common/src/EventLoop.common.kt:281)
at kotlinx.coroutines#runEventLoop(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/native/src/Builders.kt:87)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking#internal(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/native/src/Builders.kt:74)
at kotlinx.coroutines#runBlocking(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/native/src/Builders.kt:55)
at kotlinx.coroutines#runBlocking$default(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-core/native/src/Builders.kt:35)
at kotlinx.coroutines.test#createTestResult(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-test/native/src/TestBuilders.kt:12)
at kotlinx.coroutines.test#runTest__at__kotlinx.coroutines.test.TestScope(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-test/common/src/TestBuilders.kt:166)
at kotlinx.coroutines.test#runTest(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-test/common/src/TestBuilders.kt:154)
at kotlinx.coroutines.test#runTest$default(/opt/buildAgent/work/44ec6e850d5c63f0/kotlinx-coroutines-test/common/src/TestBuilders.kt:147)
I can't provide the example project as it is hard to understand for me what is happening, and the whole project is a bit complicated.
I have the issue above even If I don't use the kotlinx-coroutines-test library at all - I have a custom implementation of time control with the use of internal api too - so it looks like the issue is more in the coroutines library than the coroutines-test.
Hello,
I'm very sorry about the lack of details, but I have failing the unit tests in one of the internal class related to the kotlin coroutines.
When testing the production code that heavy rely on the coroutines (many
launch
anddelay
inside), the unit test is sometimes failing. It is not fully reproducible, as it happens only when executing./gradlew clean check
command. When I run thecheck
command (without theclean
) again then everything is passing without an issue. What's more weird, not the same test is failing after clean.The top of the callstack with the exception looks like below:
I can't provide the example project as it is hard to understand for me what is happening, and the whole project is a bit complicated.
I have the issue above even If I don't use the
kotlinx-coroutines-test
library at all - I have a custom implementation of time control with the use of internal api too - so it looks like the issue is more in thecoroutines
library than thecoroutines-test
.Versions:
kotlin-gradle-plugin:1.6.20
kotlinx-coroutines-core:1.6.0-native-mt
The text was updated successfully, but these errors were encountered: