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)