Skip to content

Commit

Permalink
Adding some timeout to failing coVerify calls
Browse files Browse the repository at this point in the history
  • Loading branch information
stigi committed Oct 7, 2024
1 parent d4e5cac commit ccfd7e8
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ internal class NotificationStoreRealTimeTests {

@Test
fun test_notifyReadNotification_withDefaultStorePredicateAndDoesntExists_shouldRefresh() = runBlocking {

// Broken on CI

// GIVEN
val predicate = StorePredicate()
val storePage = givenPageStore(predicate, defaultEdgeArraySize)
Expand All @@ -235,7 +238,7 @@ internal class NotificationStoreRealTimeTests {
storeRealTime.processMessage(RealTimeEventMock.ReadNotification("Not exists"))

// THEN
coVerify(exactly = 2) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 2, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.size.shouldBeExactly(defaultEdgeArraySize)
store.totalCount.shouldBeExactly(initialCounter.totalCount)
storePage.edges.mapIndexed { index, edge ->
Expand Down Expand Up @@ -311,7 +314,7 @@ internal class NotificationStoreRealTimeTests {
storeRealTime.processMessage(RealTimeEventMock.UnreadNotification("Not exists"))

// THEN
coVerify(exactly = 2) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 2, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.size.shouldBeExactly(defaultEdgeArraySize)
Unit
}
Expand Down Expand Up @@ -446,7 +449,7 @@ internal class NotificationStoreRealTimeTests {
storeRealTime.processMessage(RealTimeEventMock.SeenAllNotification)

// THEN
coVerify(exactly = 2) { fetchStorePageInteractor.invoke(any(), any(), any()) }
coVerify(exactly = 2, timeout = 1000) { fetchStorePageInteractor.invoke(any(), any(), any()) }
store.size.shouldBeExactly(defaultEdgeArraySize)
store.forEach { notification ->
notification.seenAt.shouldNotBeNull()
Expand Down

0 comments on commit ccfd7e8

Please sign in to comment.