Skip to content

Commit b500a30

Browse files
romtsnclaude
andcommitted
fix(test): Use Process.killProcess instead of am force-stop to preserve notifications
am force-stop (used by Maestro's killApp) clears all notifications on API 33+, causing Test 4 (COLD start via notification) to always fail. Adds a "Kill Process" button that calls Process.killProcess() which kills the app process without clearing notifications. The Maestro test now taps this button instead of using killApp. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cd5740b commit b500a30

File tree

2 files changed

+8
-3
lines changed
  • sentry-android-integration-tests/sentry-uitest-android-critical

2 files changed

+8
-3
lines changed

sentry-android-integration-tests/sentry-uitest-android-critical/maestro/appStart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ name: App Start Tests
6565
visible: "Allow"
6666
commands:
6767
- tapOn: "Allow"
68-
- tapOn: "Finish Activity"
69-
- assertNotVisible: "Welcome!"
70-
- killApp
68+
# Use "Kill Process" button instead of killApp to avoid am force-stop
69+
# which clears notifications on API 33+
70+
- tapOn: "Kill Process"
7171
- waitForAnimationToEnd
7272
- repeat:
7373
times: 5

sentry-android-integration-tests/sentry-uitest-android-critical/src/main/java/io/sentry/uitest/android/critical/MainActivity.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ class MainActivity : ComponentActivity() {
9999
) {
100100
Text("Trigger Notification")
101101
}
102+
Button(
103+
onClick = { android.os.Process.killProcess(android.os.Process.myPid()) }
104+
) {
105+
Text("Kill Process")
106+
}
102107
Button(
103108
onClick = {
104109
startActivity(

0 commit comments

Comments
 (0)