test: isolate shake detector cooldown - #8626
Merged
Merged
Conversation
supervacuus
requested review from
NinjaLikesCheez,
itaybre,
noahsmartin,
philipphofmann and
philprime
as code owners
July 30, 2026 11:02
📲 Install BuildsiOS
|
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 2fe9650 | 1228.33 ms | 1260.78 ms | 32.46 ms |
| a8fc1c8 | 1226.83 ms | 1248.19 ms | 21.36 ms |
| 27850be | 1222.65 ms | 1254.23 ms | 31.58 ms |
| 241d6ee | 1228.92 ms | 1258.47 ms | 29.55 ms |
| 6307f8b | 1216.23 ms | 1247.74 ms | 31.52 ms |
| 66415de | 1221.21 ms | 1253.28 ms | 32.07 ms |
| 62cb5fd | 1219.45 ms | 1250.56 ms | 31.11 ms |
| c4d02bd | 1219.63 ms | 1248.68 ms | 29.05 ms |
| 8bb6aeb | 1232.15 ms | 1260.78 ms | 28.63 ms |
| dff20e3 | 1225.19 ms | 1258.66 ms | 33.47 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 2fe9650 | 24.14 KiB | 1.17 MiB | 1.15 MiB |
| a8fc1c8 | 24.14 KiB | 1.23 MiB | 1.20 MiB |
| 27850be | 24.14 KiB | 1.18 MiB | 1.16 MiB |
| 241d6ee | 24.14 KiB | 1.24 MiB | 1.22 MiB |
| 6307f8b | 24.14 KiB | 1.23 MiB | 1.20 MiB |
| 66415de | 24.14 KiB | 1.16 MiB | 1.13 MiB |
| 62cb5fd | 24.14 KiB | 1.22 MiB | 1.20 MiB |
| c4d02bd | 24.14 KiB | 1.17 MiB | 1.14 MiB |
| 8bb6aeb | 24.14 KiB | 1.17 MiB | 1.15 MiB |
| dff20e3 | 24.14 KiB | 1.15 MiB | 1.13 MiB |
philprime
pushed a commit
that referenced
this pull request
Jul 30, 2026
* test: isolate shake detector cooldown * guard the test against NoUIFramework compilation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
SentryShakeDetector's process-wide cooldown stateSentryShakeDetectorTeststest💡 Motivation and Context
SentryShakeDetectorTests.testEnable_whenShakeOccurs_shouldPostNotificationcan fail depending on test order and timing. A shake from the preceding test updates the process-widelastShakeTimestamp, anddisable()does not reset it. If the next shake occurs within the one-second cooldown, its notification is suppressed.This was observed in a CI run for #8589.
Resetting the cooldown in
disable()itself may be reasonable because re-enabling could be considered a new detection session. However, doing so would change production behavior by allowing a shake immediately after a disable/re-enable cycle, which could make sense, but I am not sure whether separating the life-cycle from the cooldown wasn't intentional. If it wasn't, I am happy to integrate it intodisable()instead.💚 How did you test it?
I only ran the affected tests to check that nothing broke there. No production code was modified (yet, see above).
📝 Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled.