test: make viewmodel and notification receiver tests deterministic (#1207)

This commit is contained in:
m57
2026-09-21 16:53:10 +03:00
committed by GitHub
parent 29fdb52978
commit fa2b388b24
9 changed files with 52 additions and 66 deletions
@@ -26,15 +26,7 @@ class LogsViewModelTest {
private val testDispatcher = StandardTestDispatcher()
private val mockApi = mockk<HermesApiService>(relaxed = true)
/**
* Pump the test scheduler while letting the real Dispatchers.IO hops
* (safeLaunchLoad / withContext(IO)) land their resumptions.
*/
private fun settle() {
repeat(20) {
testDispatcher.scheduler.advanceUntilIdle()
Thread.sleep(10)
}
testDispatcher.scheduler.advanceUntilIdle()
}