Skip to content

Commit

Permalink
Added detach delay to fix test flakiness for channel detach
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Nov 11, 2024
1 parent 4fc33c7 commit 097e82c
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ class RoomLifecycleManagerTest {

val detachedChannels = mutableListOf<io.ably.lib.realtime.Channel>()
coEvery { any<io.ably.lib.realtime.Channel>().detachCoroutine() } coAnswers {
delay(200)
detachedChannels.add(firstArg())
}

Expand Down Expand Up @@ -379,6 +380,7 @@ class RoomLifecycleManagerTest {
var failDetachTimes = 5
val detachedChannels = mutableListOf<io.ably.lib.realtime.Channel>()
coEvery { any<io.ably.lib.realtime.Channel>().detachCoroutine() } coAnswers {
delay(200)
if (--failDetachTimes >= 0) {
error("failed to detach channel")
}
Expand Down

0 comments on commit 097e82c

Please sign in to comment.