Skip to content

Commit

Permalink
Add debug output to flx progress listener test
Browse files Browse the repository at this point in the history
  • Loading branch information
rorbech committed Jul 17, 2024
1 parent b1534c2 commit fa325a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import io.realm.kotlin.Realm
import io.realm.kotlin.entities.sync.SyncObjectWithAllTypes
import io.realm.kotlin.ext.query
import io.realm.kotlin.internal.platform.runBlocking
import io.realm.kotlin.log.LogLevel
import io.realm.kotlin.log.RealmLog
import io.realm.kotlin.mongodb.User
import io.realm.kotlin.mongodb.sync.Direction
import io.realm.kotlin.mongodb.sync.Progress
Expand All @@ -40,6 +42,7 @@ import kotlinx.coroutines.flow.buffer
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.last
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.flow.scan
import kotlinx.coroutines.flow.takeWhile
import kotlinx.coroutines.supervisorScope
Expand Down Expand Up @@ -146,10 +149,12 @@ class FLXProgressListenerTests {

@Test
fun uploadProgressListener_changesOnly() = runBlocking {
RealmLog.setLevel(LogLevel.ALL)
Realm.open(createSyncConfig(app.createUserAndLogin())).use { realm ->
for (i in 0..3) {
realm.writeSampleData(TEST_SIZE, timeout = TIMEOUT)
realm.syncSession.progressAsFlow(Direction.UPLOAD, ProgressMode.CURRENT_CHANGES)
.onEach { println("Progress[$i] $it") }
.run {
withTimeout(TIMEOUT) {
last().let {

Check failure on line 160 in packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FLXProgressListenerTests.kt

View workflow job for this annotation

GitHub Actions / Unit Test Results - Sync JVM MacOS arm64

io.realm.kotlin.test.mongodb.common.FLXProgressListenerTests ► uploadProgressListener_changesOnly[jvm]

Failed test found in: ./packages/test-sync/build/test-results/jvmTest/TEST-io.realm.kotlin.test.mongodb.common.FLXProgressListenerTests.xml Error: kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 30000 ms
Raw output
kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 30000 ms
	at _COROUTINE._BOUNDARY._(CoroutineDebugging.kt:46)
	at kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt(Channels.kt:36)
	at kotlinx.coroutines.flow.internal.ChannelFlow$collect$2.invokeSuspend(ChannelFlow.kt:123)
	at kotlinx.coroutines.flow.FlowKt__ReduceKt.last(Reduce.kt:155)
	at io.realm.kotlin.test.mongodb.common.FLXProgressListenerTests$uploadProgressListener_changesOnly$1$1$2$1.invokeSuspend(FLXProgressListenerTests.kt:160)
	at io.realm.kotlin.test.mongodb.common.FLXProgressListenerTests$uploadProgressListener_changesOnly$1.invokeSuspend(FLXProgressListenerTests.kt:159)
Caused by: kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 30000 ms
	at app//kotlinx.coroutines.TimeoutKt.TimeoutCancellationException(Timeout.kt:191)
	at app//kotlinx.coroutines.TimeoutCoroutine.run(Timeout.kt:159)
	at app//kotlinx.coroutines.EventLoopImplBase$DelayedRunnableTask.run(EventLoop.common.kt:501)
	at app//kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
	at app//kotlinx.coroutines.DefaultExecutor.run(DefaultExecutor.kt:108)
	at [email protected]/java.lang.Thread.run(Thread.java:829)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import io.realm.kotlin.test.util.use
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.withTimeout
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue
import kotlin.time.Duration.Companion.seconds

Expand Down

0 comments on commit fa325a0

Please sign in to comment.