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 974237a commit 83dc303
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,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 @@ -238,7 +241,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 @@ -314,7 +317,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 @@ -449,7 +452,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 83dc303

Please sign in to comment.