Skip to content

fix(test): Fix flaky MainEventProcessorTest by checking crashed thread#5126

Merged
adinauer merged 2 commits intomainfrom
fix/flaky-test-main-event-processor
Feb 27, 2026
Merged

fix(test): Fix flaky MainEventProcessorTest by checking crashed thread#5126
adinauer merged 2 commits intomainfrom
fix/flaky-test-main-event-processor

Conversation

@adinauer
Copy link
Member

#skip-changelog

📜 Description

Fix MainEventProcessorTest to assert the stacktrace on the crashed thread (isCrashed == true) instead of the first thread in the list. Thread ordering is non-deterministic, so first() may return a non-crashed thread causing the test to flake.

💡 Motivation and Context

This test was flaky due to the new SentryOptions.activate changes affecting thread ordering. The fix ensures we find the correct crashed thread before asserting on its stacktrace.

💚 How did you test it?

Verified the previously flaky test now passes consistently.

📝 Checklist

  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

None.

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>
@adinauer adinauer marked this pull request as ready for review February 27, 2026 10:54
@github-actions
Copy link
Contributor

github-actions bot commented Feb 27, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 27, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 306.71 ms 355.49 ms 48.78 ms
Size 1.58 MiB 2.29 MiB 720.88 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
e59e22a 329.74 ms 383.31 ms 53.57 ms
fc5ccaf 270.49 ms 363.90 ms 93.41 ms
d15471f 361.89 ms 378.07 ms 16.18 ms
d15471f 322.58 ms 396.08 ms 73.50 ms
abfcc92 304.04 ms 370.33 ms 66.29 ms
91bb874 310.68 ms 359.24 ms 48.56 ms
ab8a72d 316.24 ms 356.38 ms 40.14 ms
d15471f 286.65 ms 314.68 ms 28.03 ms
6727e14 337.22 ms 373.94 ms 36.71 ms
f064536 329.00 ms 395.62 ms 66.62 ms

App size

Revision Plain With Sentry Diff
e59e22a 1.58 MiB 2.20 MiB 635.34 KiB
fc5ccaf 1.58 MiB 2.13 MiB 557.54 KiB
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
abfcc92 1.58 MiB 2.13 MiB 557.31 KiB
91bb874 1.58 MiB 2.13 MiB 559.07 KiB
ab8a72d 1.58 MiB 2.12 MiB 551.55 KiB
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
6727e14 1.58 MiB 2.28 MiB 718.64 KiB
f064536 1.58 MiB 2.20 MiB 633.90 KiB

Previous results on branch: fix/flaky-test-main-event-processor

Startup times

Revision Plain With Sentry Diff
b7f9745 306.38 ms 352.51 ms 46.13 ms

App size

Revision Plain With Sentry Diff
b7f9745 1.58 MiB 2.29 MiB 720.89 KiB

@adinauer adinauer enabled auto-merge (squash) February 27, 2026 12:18
@adinauer adinauer merged commit 9dc12d1 into main Feb 27, 2026
63 checks passed
@adinauer adinauer deleted the fix/flaky-test-main-event-processor branch February 27, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants