test(flutter): Remove flaky frames measurement tests#3783
Conversation
The two 'measures frames' integration tests drive real frames through the binding's wall-clock Stopwatch, so on a loaded CI runner a 100ms slow frame can stretch past the 700ms frozen threshold and be reclassified. Earlier hardening (#3750) relaxed the assertions to combined counts and lower bounds, but the tests still flake. Their coverage is redundant: classification math is covered by sentry_delayed_frames_tracker_test, attribute/measurement application by span_frame_metrics_collector_test, and callback registration and cleanup by the remaining tests in this file. Remove the two cases along with their now-dead helpers and the unused material import. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Features
Enhancements
DependenciesDeps
Internal Changes
🤖 This preview updates automatically when you update the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3783 +/- ##
==========================================
+ Coverage 87.07% 91.46% +4.39%
==========================================
Files 336 105 -231
Lines 12064 3763 -8301
==========================================
- Hits 10505 3442 -7063
+ Misses 1559 321 -1238
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Android Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| e2d675d | 457.92 ms | 529.17 ms | 71.25 ms |
| 5367726 | 380.04 ms | 361.33 ms | -18.71 ms |
| e200a70 | 433.06 ms | 437.00 ms | 3.94 ms |
| c97f488 | 502.43 ms | 492.47 ms | -9.97 ms |
| 5a95d04 | 378.92 ms | 364.33 ms | -14.59 ms |
| 8af916c | 367.83 ms | 379.60 ms | 11.77 ms |
| 73a3c38 | 478.18 ms | 526.62 ms | 48.44 ms |
| 40751bf | 421.09 ms | 424.82 ms | 3.73 ms |
| f872f8e | 402.38 ms | 416.20 ms | 13.82 ms |
| 1fff351 | 423.68 ms | 408.96 ms | -14.72 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| e2d675d | 6.54 MiB | 7.69 MiB | 1.15 MiB |
| 5367726 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| e200a70 | 13.93 MiB | 15.18 MiB | 1.25 MiB |
| c97f488 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| 5a95d04 | 13.93 MiB | 15.06 MiB | 1.13 MiB |
| 8af916c | 14.31 MiB | 15.56 MiB | 1.25 MiB |
| 73a3c38 | 6.54 MiB | 7.69 MiB | 1.15 MiB |
| 40751bf | 14.31 MiB | 15.49 MiB | 1.19 MiB |
| f872f8e | 13.93 MiB | 15.18 MiB | 1.25 MiB |
| 1fff351 | 14.31 MiB | 15.49 MiB | 1.19 MiB |
iOS Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| d0371bb | 1258.85 ms | 1259.44 ms | 0.60 ms |
| dc53d48 | 1252.06 ms | 1255.61 ms | 3.55 ms |
| c26ed0a | 1244.11 ms | 1263.85 ms | 19.75 ms |
| 81f83eb | 1259.53 ms | 1273.39 ms | 13.86 ms |
| 40c8f93 | 1234.27 ms | 1261.98 ms | 27.71 ms |
| dbd526b | 1244.78 ms | 1259.02 ms | 14.24 ms |
| 73dca78 | 1246.65 ms | 1265.42 ms | 18.76 ms |
| 737ef5d | 1255.65 ms | 1252.24 ms | -3.41 ms |
| 3801d52 | 1267.76 ms | 1266.10 ms | -1.65 ms |
| 5367726 | 1211.00 ms | 1216.73 ms | 5.73 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| d0371bb | 5.73 MiB | 6.18 MiB | 464.41 KiB |
| dc53d48 | 5.65 MiB | 6.09 MiB | 446.96 KiB |
| c26ed0a | 5.53 MiB | 5.97 MiB | 453.76 KiB |
| 81f83eb | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| 40c8f93 | 5.53 MiB | 6.00 MiB | 479.94 KiB |
| dbd526b | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| 73dca78 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
| 737ef5d | 5.73 MiB | 6.18 MiB | 466.16 KiB |
| 3801d52 | 5.73 MiB | 6.17 MiB | 455.54 KiB |
| 5367726 | 5.73 MiB | 6.17 MiB | 455.87 KiB |
There was a problem hiding this comment.
Pull request overview
This PR removes two flaky Flutter integration tests that measured delayed frames via real wall-clock timing, reducing nondeterministic CI failures while keeping deterministic coverage in unit tests and the remaining integration tests in this file.
Changes:
- Deleted the two
measures frameswidget/integration tests (stream + static lifecycle) and their helper utilities. - Removed now-unused Flutter Material import (
package:flutter/material.dart). - Kept the remaining frames-tracking integration tests that validate callback registration and cleanup behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📜 Description
Removes the two
measures framesintegration tests (with stream lifecycleandwith static lifecycle) fromframes_tracking_integration_test.dart, along with their now-dead helpers (simulateFrames,buildTestApp, thehub/slowFrame/frozenFramesetup) and the now-unusedpackage:flutter/material.dartimport.💡 Motivation and Context
These tests drive real frames through the binding's wall-clock
Stopwatch, so on a loaded CI runner a 100ms "slow" frame can stretch past the 700ms "frozen" threshold and be reclassified — producing nondeterministic slow/frozen counts. Earlier hardening (#3750) relaxed the assertions to combined counts and lower bounds, but the tests still flake (they failed again on a recent unrelated PR run).Their coverage is redundant with existing deterministic tests:
sentry_delayed_frames_tracker_test.dartspan_frame_metrics_collector_test.dartThe only coverage lost is the binding's real-time
Stopwatchmeasurement end to end — the ~6-line block that is the sole source of the flake.💚 How did you test it?
flutter analyzereports no issues and the remaining 11 tests in the file pass locally.📝 Checklist
sendDefaultPiiis enabled🔮 Next steps
Optionally add a focused, deterministic binding-measurement test (behind a small injectable-time seam) to recover that single coverage gap without reintroducing wall-clock flakiness.