From 8c96226f8de67d35cc67d25190bece8ebc00884e Mon Sep 17 00:00:00 2001 From: sacOO7 Date: Mon, 11 Nov 2024 21:49:42 +0530 Subject: [PATCH] Fixed flaky test for RoomLifecycleManager, when room enters failed state --- .../src/test/java/com/ably/chat/RoomLifecycleManagerTest.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/chat-android/src/test/java/com/ably/chat/RoomLifecycleManagerTest.kt b/chat-android/src/test/java/com/ably/chat/RoomLifecycleManagerTest.kt index 6f6cc73b..b4392e45 100644 --- a/chat-android/src/test/java/com/ably/chat/RoomLifecycleManagerTest.kt +++ b/chat-android/src/test/java/com/ably/chat/RoomLifecycleManagerTest.kt @@ -323,6 +323,7 @@ class RoomLifecycleManagerTest { coEvery { any().attachCoroutine() } coAnswers { val channel = firstArg() if ("typing" in channel.name) { + delay(500) // Throw error for typing contributor, likely to throw because it uses different channel val error = ErrorInfo("error attaching channel ${channel.name}", 500) channel.setState(ChannelState.failed, error)