Skip to content

Commit

Permalink
Merge branch 'main' into rz/fix/slow-replay-main-thread
Browse files Browse the repository at this point in the history
  • Loading branch information
romtsn authored Oct 16, 2024
2 parents 60b5b1e + bd82483 commit 086acad
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.app.ApplicationExitInfo
import android.content.Context
import android.os.Build
import android.os.Bundle
import android.os.Looper
import android.os.SystemClock
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
Expand Down Expand Up @@ -55,6 +56,7 @@ import org.mockito.kotlin.spy
import org.mockito.kotlin.times
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
import org.robolectric.Shadows
import org.robolectric.annotation.Config
import org.robolectric.shadow.api.Shadow
import org.robolectric.shadows.ShadowActivityManager
Expand Down Expand Up @@ -439,8 +441,10 @@ class SentryAndroidTest {
await.withAlias("Failed because of BeforeSend callback above, but we swallow BeforeSend exceptions, hence the timeout")
.untilTrue(asserted)

// Execute all posted tasks
Shadows.shadowOf(Looper.getMainLooper()).idle()

// assert that persisted values have changed
options.executorService.close(10000L) // finalizes all enqueued persisting tasks
assertEquals(
"TestActivity",
PersistingScopeObserver.read(options, TRANSACTION_FILENAME, String::class.java)
Expand Down

0 comments on commit 086acad

Please sign in to comment.