How to test concurrency related issues with kotlin courtines
I am debugging an issue that involves doing two tasks concurrently:
suspend fun method1() =
withContext(Dispatchers.IO) {
dao.getAllLogsAndClearDataBase()
}
private val coroutineScope = CoroutineScope(Dispatchers.IO)
fun method2(log: Log) {
coroutineScope.launch {
dao.insertLog(log)
}
}
Both use Dispatchers.IO and I have crashes in Crashlytics showing that we're inside of method1's getAllLogsAndClearDataBase and also...