-
-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Rare flush timeout when called in tight loop #4257
Conversation
Fix an edge case that flush could keep timing out when called in a tight loop. The test case testFlush_WhenNoInternet_BlocksAndFinishes does this and sometimes fails with 'Flush should not time out'. This is fixed now, by removing the duplicate setting of isFlushing to NO in two different synchronize blocks.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4257 +/- ##
=============================================
+ Coverage 91.460% 91.514% +0.053%
=============================================
Files 611 612 +1
Lines 49384 49471 +87
Branches 17841 17915 +74
=============================================
+ Hits 45167 45273 +106
+ Misses 4123 4105 -18
+ Partials 94 93 -1
... and 18 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
1bbcb9c | 1192.51 ms | 1231.96 ms | 39.45 ms |
d6ff82c | 1219.06 ms | 1244.31 ms | 25.24 ms |
9ef729b | 1228.79 ms | 1245.36 ms | 16.57 ms |
5eaadc5 | 1236.24 ms | 1245.45 ms | 9.20 ms |
c0b4b71 | 1246.98 ms | 1256.77 ms | 9.79 ms |
b9b0f0a | 1251.45 ms | 1257.86 ms | 6.41 ms |
cc31630 | 1235.22 ms | 1252.51 ms | 17.29 ms |
94b89eb | 1236.08 ms | 1264.58 ms | 28.50 ms |
94e1968 | 1230.22 ms | 1253.33 ms | 23.11 ms |
48e8c2e | 1233.78 ms | 1255.44 ms | 21.66 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
1bbcb9c | 20.76 KiB | 426.10 KiB | 405.34 KiB |
d6ff82c | 21.58 KiB | 616.14 KiB | 594.56 KiB |
9ef729b | 20.76 KiB | 432.88 KiB | 412.12 KiB |
5eaadc5 | 21.58 KiB | 651.06 KiB | 629.48 KiB |
c0b4b71 | 20.76 KiB | 430.98 KiB | 410.22 KiB |
b9b0f0a | 20.76 KiB | 434.94 KiB | 414.18 KiB |
cc31630 | 21.58 KiB | 694.58 KiB | 672.99 KiB |
94b89eb | 20.76 KiB | 399.20 KiB | 378.43 KiB |
94e1968 | 21.58 KiB | 614.74 KiB | 593.15 KiB |
48e8c2e | 21.58 KiB | 418.45 KiB | 396.86 KiB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The BucketMetricsAggregatorTests
test for tvOS is failing consistently, but I can't reproduce it locally
I will have a look. Thanks for the hint. |
📜 Description
Fix an edge case that flush could keep timing out when called in a tight loop. The test case testFlush_WhenNoInternet_BlocksAndFinishes does this and sometimes fails with 'Flush should not time out'. This is fixed now by removing the duplicate setting of isFlushing to NO in two different synchronize blocks.
💡 Motivation and Context
This came up while investigating the flaky test
testFlush_WhenNoInternet_BlocksAndFinishes
in here https://github.com/getsentry/sentry-cocoa/actions/runs/10297370247/job/28500398785?pr=4255Test Log output
💚 How did you test it?
It's really hard to test locally. The tests are still green and CI will hopefully not surface this failing test again.
📝 Checklist
You have to check all boxes before merging:
sendDefaultPII
is enabled.🔮 Next steps