Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unit test #137

Closed
hoc081098 opened this issue Feb 25, 2024 · 0 comments
Closed

Fix unit test #137

hoc081098 opened this issue Feb 25, 2024 · 0 comments
Assignees

Comments

@hoc081098
Copy link
Owner

com.hoc081098.kmp.viewmodel.ViewModelTest > addCloseablesThatWillBeClosedWhenClear_multiThreads FAILED
    java.lang.IllegalStateException: Already closed!
        at _COROUTINE._BOUNDARY._(CoroutineDebugging.kt:42)
        at com.hoc081098.kmp.viewmodel.ViewModelTest$addCloseablesThatWillBeClosedWhenClear_multiThreads$1$2$1.invokeSuspend(ViewModelTest.kt:125)

        Caused by:
        java.lang.IllegalStateException: Already closed!
            at com.hoc081098.kmp.viewmodel.utils.TestCloseable.close(TestCloseable.kt:10)
            at androidx.lifecycle.ViewModel.closeWithRuntimeException(ViewModel.java:252)
            at androidx.lifecycle.ViewModel.clear(ViewModel.java:197)
            at androidx.lifecycle.ViewModelStore.clear(ViewModelStore.kt:69)
            at com.hoc081098.kmp.viewmodel.ViewModelStore.clear(ViewModelStore.android.kt:46)
            at com.hoc081098.kmp.viewmodel.ViewModelTestKt$createTestViewModel$2.invoke(ViewModelTest.kt:53)
            at com.hoc081098.kmp.viewmodel.ViewModelTestKt$createTestViewModel$2.invoke(ViewModelTest.kt:53)
            at com.hoc081098.kmp.viewmodel.utils.RunBlockInNewThread_androidKt$runBlockInNewThread$2$2.run(runBlockInNewThread.android.kt:13)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
            at java.base/java.lang.Thread.run(Thread.java:840)
@hoc081098 hoc081098 self-assigned this Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant