Skip to content

Commit 9dc12d1

Browse files
adinauerclaude
andauthored
fix(test): Fix flaky MainEventProcessorTest by checking crashed thread (#5126)
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 8f80cf4 commit 9dc12d1

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)