Skip to content

test(flutter): Remove flaky frames measurement tests#3783

Merged
buenaflor merged 1 commit into
mainfrom
test/remove-flaky-frames-measure-tests
Jun 24, 2026
Merged

test(flutter): Remove flaky frames measurement tests#3783
buenaflor merged 1 commit into
mainfrom
test/remove-flaky-frames-measure-tests

Conversation

@buenaflor

Copy link
Copy Markdown
Contributor

📜 Description

Removes the two measures frames integration tests (with stream lifecycle and with static lifecycle) from frames_tracking_integration_test.dart, along with their now-dead helpers (simulateFrames, buildTestApp, the hub/slowFrame/frozenFrame setup) and the now-unused package:flutter/material.dart import.

💡 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:

  • Slow/frozen/total classification math → sentry_delayed_frames_tracker_test.dart
  • Attribute/measurement application to spans (both lifecycles, concurrent spans) → span_frame_metrics_collector_test.dart
  • Integration callback registration and cleanup → the remaining tests in this same file

The only coverage lost is the binding's real-time Stopwatch measurement end to end — the ~6-line block that is the sole source of the flake.

💚 How did you test it?

flutter analyze reports no issues and the remaining 11 tests in the file pass locally.

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 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.

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]>
@github-actions

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

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


Features

  • (dart) Mark span streaming API as non-experimental by buenaflor in #3756

Enhancements

  • (flutter) Support int64 values from sentry-native by buenaflor in #3760

Dependencies

Deps

  • chore(deps): update Android SDK to v8.44.1 by github-actions in #3777
  • chore(deps): update Native SDK to v0.15.1 by github-actions in #3757
  • chore(deps): update Android SDK to v8.44.0 by github-actions in #3776

Internal Changes

  • (flutter) Remove flaky frames measurement tests by buenaflor in #3783

🤖 This preview updates automatically when you update the PR.

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.46%. Comparing base (3ff5987) to head (39eaab3).
✅ All tests successful. No failed tests found.

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     
Flag Coverage Δ
sentry ?
sentry_dio ?
sentry_drift ?
sentry_file ?
sentry_firebase_remote_config 100.00% <ø> (ø)
sentry_flutter 91.05% <ø> (-0.46%) ⬇️
sentry_hive ?
sentry_isar ?
sentry_link ?
sentry_logging ?
sentry_sqflite ?
sentry_supabase 97.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@github-actions

Copy link
Copy Markdown
Contributor

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 340.64 ms 345.67 ms 5.02 ms
Size 14.55 MiB 15.87 MiB 1.31 MiB

Baseline results on branch: main

Startup times

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

@github-actions

Copy link
Copy Markdown
Contributor

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1240.43 ms 1249.78 ms 9.34 ms
Size 5.83 MiB 6.28 MiB 459.39 KiB

Baseline results on branch: main

Startup times

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

@buenaflor
buenaflor marked this pull request as ready for review June 24, 2026 08:29
@buenaflor
buenaflor requested a review from denrase as a code owner June 24, 2026 08:29
Copilot AI review requested due to automatic review settings June 24, 2026 08:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 frames widget/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.

@buenaflor
buenaflor merged commit 1ba6064 into main Jun 24, 2026
74 of 75 checks passed
@buenaflor
buenaflor deleted the test/remove-flaky-frames-measure-tests branch June 24, 2026 09:35
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.

3 participants