Skip to content

Commit 7919f63

Browse files
adinauerclaude
andcommitted
fix(test): Fix flaky MainEventProcessorTest by checking crashed thread
Assert stacktrace on the crashed thread instead of the first thread in the list, which may not be the crashed one depending on thread ordering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0d66c0b commit 7919f63

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sentry/src/test/java/io/sentry/MainEventProcessorTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class MainEventProcessorTest {
258258

259259
assertNotNull(event.threads)
260260
assertEquals(1, event.threads!!.count { it.isCrashed == true })
261-
assertNotNull(event.threads!!.first().stacktrace)
261+
assertNotNull(event.threads!!.first { it.isCrashed == true }.stacktrace)
262262
}
263263

264264
@Test

0 commit comments

Comments
 (0)