Skip to content

Commit 93b9fd4

Browse files
romtsnclaude
andcommitted
fix(test): Remove initNotThrowStrictMode test
This test validated that StrictMode with penaltyDeath() didn't crash during SDK init. Since we removed the RuntimeManager that relaxed StrictMode, this test is no longer applicable — the SDK no longer attempts to suppress StrictMode violations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a7bcbf6 commit 93b9fd4

File tree

1 file changed

+0
-49
lines changed
  • sentry-android-integration-tests/sentry-uitest-android/src/androidTest/java/io/sentry/uitest/android

1 file changed

+0
-49
lines changed

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

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.sentry.uitest.android
22

3-
import android.os.StrictMode
43
import androidx.lifecycle.Lifecycle
54
import androidx.test.core.app.launchActivity
65
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -254,54 +253,6 @@ class SdkInitTests : BaseUiTest() {
254253
assertDefaultIntegrations()
255254
}
256255

257-
@Test
258-
fun initNotThrowStrictMode() {
259-
StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder().detectAll().penaltyDeath().build())
260-
StrictMode.setVmPolicy(
261-
StrictMode.VmPolicy.Builder()
262-
.detectActivityLeaks()
263-
// .detectCleartextNetwork() <- mockWebServer is on http, not https
264-
.detectContentUriWithoutPermission()
265-
.detectCredentialProtectedWhileLocked()
266-
.detectFileUriExposure()
267-
.detectImplicitDirectBoot()
268-
.detectIncorrectContextUse()
269-
.detectLeakedRegistrationObjects()
270-
.detectLeakedSqlLiteObjects()
271-
// .detectNonSdkApiUsage() <- thrown by leakCanary
272-
// .detectUnsafeIntentLaunch() <- fails CI with java.lang.NoSuchMethodError
273-
// .detectUntaggedSockets() <- thrown by mockWebServer
274-
.penaltyDeath()
275-
.build()
276-
)
277-
initSentry(true) { it.tracesSampleRate = 1.0 }
278-
val sampleScenario = launchActivity<EmptyActivity>()
279-
relayIdlingResource.increment()
280-
relayIdlingResource.increment()
281-
Sentry.captureException(Exception("test"))
282-
sampleScenario.moveToState(Lifecycle.State.DESTROYED)
283-
284-
// Avoid interferences with other tests and assertion logic
285-
StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.LAX)
286-
StrictMode.setVmPolicy(StrictMode.VmPolicy.LAX)
287-
288-
relay.assert {
289-
findEnvelope {
290-
assertEnvelopeEvent(it.items.toList()).exceptions!!.any { it.value == "test" }
291-
}
292-
.assert {
293-
it.assertEvent()
294-
it.assertNoOtherItems()
295-
}
296-
findEnvelope { assertEnvelopeTransaction(it.items.toList()).transaction == "EmptyActivity" }
297-
.assert {
298-
it.assertTransaction()
299-
it.assertNoOtherItems()
300-
}
301-
assertNoOtherEnvelopes()
302-
}
303-
}
304-
305256
private fun assertDefaultIntegrations() {
306257
val integrations =
307258
mutableListOf(

0 commit comments

Comments
 (0)