diff --git a/app/src/test/java/com/nextcloud/talk/chat/data/network/OfflineFirstChatRepositoryTest.kt b/app/src/test/java/com/nextcloud/talk/chat/data/network/OfflineFirstChatRepositoryTest.kt index e9078eb57e5..9accbc85499 100644 --- a/app/src/test/java/com/nextcloud/talk/chat/data/network/OfflineFirstChatRepositoryTest.kt +++ b/app/src/test/java/com/nextcloud/talk/chat/data/network/OfflineFirstChatRepositoryTest.kt @@ -280,10 +280,12 @@ class OfflineFirstChatRepositoryTest { runCurrent() verifyBlocking(network, never()) { pullChatMessages(any(), any(), any()) } - // ... and the request is sent on it + // ... and the request is sent on it, from the pull flow on Dispatchers.IO that runCurrent doesn't wait for advanceTimeBy(INSURANCE_DELAY_MS / 2) runCurrent() - verifyBlocking(network, times(1)) { pullChatMessages(eq(CREDENTIALS), eq(CHAT_URL), any()) } + verifyBlocking(network, timeout(AWAIT_TIMEOUT_MILLIS).times(1)) { + pullChatMessages(eq(CREDENTIALS), eq(CHAT_URL), any()) + } polling.cancelAndJoin() }