Skip to content

Commit 59d3866

Browse files
committed
updated test to check for new options
1 parent bd2566b commit 59d3866

File tree

1 file changed

+15
-5
lines changed
  • sentry-android-integration-tests/sentry-uitest-android/src/androidTest/java/io/sentry/uitest/android

1 file changed

+15
-5
lines changed

sentry-android-integration-tests/sentry-uitest-android/src/androidTest/java/io/sentry/uitest/android/SdkInitTests.kt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,7 @@ class SdkInitTests : BaseUiTest() {
112112

113113
@Test
114114
fun doubleInitDoesNotWait() {
115-
initSentry()
116-
117-
// We want the SDK to start sending the event. If we don't wait, it's possible we don't send
118-
// anything before the SDK is restarted
119-
waitUntilIdle()
115+
initSentry(true)
120116

121117
val beforeRestart = System.currentTimeMillis()
122118
// We restart the SDK. This shouldn't block the main thread, but new options (e.g. profiling)
@@ -128,9 +124,23 @@ class SdkInitTests : BaseUiTest() {
128124
val afterRestart = System.currentTimeMillis()
129125
val restartMs = afterRestart - beforeRestart
130126

127+
relayIdlingResource.increment()
128+
Sentry.startTransaction("afterRestart", "emptyTransaction").finish()
129+
131130
// We assert for less than 1 second just to account for slow devices in saucelabs or headless
132131
// emulator
133132
assertTrue(restartMs < 1000, "Expected less than 1000 ms for SDK restart. Got $restartMs ms")
133+
134+
relay.assert {
135+
findEnvelope { assertEnvelopeTransaction(it.items.toList()).transaction == "afterRestart" }
136+
.assert {
137+
it.assertTransaction()
138+
// There is a profiling item, as in the second init it was enabled
139+
it.assertProfile()
140+
it.assertNoOtherItems()
141+
}
142+
assertNoOtherEnvelopes()
143+
}
134144
}
135145

136146
@Test

0 commit comments

Comments
 (0)