Skip to content

[google_fonts] Make the pendingFonts test deterministic - #13262

Merged
auto-submit[bot] merged 1 commit into
flutter:mainfrom
okorohelijah:google_fonts-pendingfonts-test
Oct 15, 2026
Merged

auto-submit[bot] merged 1 commit into
flutter:mainfrom
okorohelijah:google_fonts-pendingfonts-test

Conversation

@okorohelijah

@okorohelijah okorohelijah commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

pendingFonts waits for fonts to be loaded fails on roughly 3 out of 10 runs of Windows_x64 dart_unit_tests_shard_1, and only for PRs that make the tool run every package (.ci/, script/, Flutter rolls, ...), so it never shows up in postsubmit and blocks exactly the PRs that can't avoid it. The history and the analysis are in flutter/flutter#194407; the short version:

  • The three expects in the test pass on every platform. The failure is a late error that flips an already-passed test to failed (the CI log shows the pass counter dropping from +92 to +91 -1 with no [E] block).
  • After the mock HTTP fetch, _httpFetchFontAndSaveToDevice writes the font to the application support directory without awaiting the result. The test does not fake PathProviderPlatform, so under flutter test that write fails with MissingPluginException inside the dropped future, after the test body has returned. This file has a single test, so whether the runner is still attached when the error lands is a timing question; Linux consistently loses the error, Windows regularly does not.
  • Keeping the test alive for two seconds after its last expect reproduces the error on Linux every time.

This change installs the same FakePathProviderPlatform pointing at a temp directory that load_font_if_necessary_test.dart already uses, so the background write succeeds and there is no straggler error. With the change, the "wait two seconds" variant passes.

Test-only change, so no version or CHANGELOG update (exempt category: PRs that only affect tests).

Fixes flutter/flutter#194407
Unblocks #13223

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2

The test exercised the HTTP fetch path without faking PathProviderPlatform,
so the package's background write to the application support directory
failed with MissingPluginException after the test body had finished.
Whether that late error was still attributed to the test was a matter of
timing; on Windows CI it was, roughly 3 runs out of 10.

Point the package at a temp directory the same way
load_font_if_necessary_test.dart already does.

Fixes flutter/flutter#194407
@github-actions github-actions Bot added p: google_fonts triage-design Should be looked at in design triage labels Oct 14, 2026
@okorohelijah okorohelijah reopened this Oct 15, 2026
@fluttergithubbot

Copy link
Copy Markdown
Contributor

An existing Git SHA, 375702ed6074ac1d5d88b78438845bb0ea3c97c2, was detected, and no actions were taken.

To re-trigger presubmits after closing or re-opeing a PR, or pushing a HEAD commit (i.e. with --force) that already was pushed before, push a blank commit (git commit --allow-empty -m "Trigger Build") or rebase to continue.

@okorohelijah
okorohelijah marked this pull request as ready for review October 15, 2026 18:36

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates google_fonts_text_style_test.dart to run on the VM and configures a fake PathProviderPlatform using a temporary directory to prevent late-write errors. Feedback suggests registering a tear-down callback to delete the temporary directory and avoid leaking resources.

@Piinks Piinks added override: no versioning needed Override the check requiring version bumps for most changes override: no changelog needed Override the check requiring CHANGELOG updates for most changes labels Oct 15, 2026

@Piinks Piinks 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.

LGTM! Thank you for this!

@Piinks Piinks added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Oct 15, 2026
@auto-submit
auto-submit Bot merged commit 437a0ff into flutter:main Oct 15, 2026
21 checks passed
gmackall pushed a commit to gmackall/flutter that referenced this pull request Oct 16, 2026
…r#194564)

flutter/packages@da40eaf...93eede7

2026-10-16 41930132+hellohuanlin@users.noreply.github.com [camera]fix a
crash when switching camera while recording due to disconnected
capturePhotoOputput (flutter/packages#13248)
2026-10-16 okorohelijah@google.com [various] Update iOS example apps to
the 15.0 deployment target (flutter/packages#13223)
2026-10-16 36861262+QuncCccccc@users.noreply.github.com [material_ui]
Add M3E `IconButton` example (flutter/packages#13085)
2026-10-15 magder@google.com [ci] Increase deprecation check minimum to
iOS 16 (flutter/packages#13211)
2026-10-15 victor.orozco@cloudsufi.com [google_sign_in] Remove the
public iOS handleOpen helper (flutter/packages#13273)
2026-10-15 okorohelijah@google.com [google_fonts] Make the pendingFonts
test deterministic (flutter/packages#13262)
2026-10-15 48776784+mackings@users.noreply.github.com
[vector_graphics_compiler] Fix tspan transform applied twice
(flutter/packages#13129)
2026-10-15 engine-flutter-autoroll@skia.org Roll Flutter from
426be96 to 5c7e45a (21 revisions) (flutter/packages#13270)
2026-10-15 37883572+edwin-hollen@users.noreply.github.com [flutter_svg]
Add golden widget tests for SVG alpha masks (flutter/packages#13245)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
…r#194564)

flutter/packages@da40eaf...93eede7

2026-10-16 41930132+hellohuanlin@users.noreply.github.com [camera]fix a
crash when switching camera while recording due to disconnected
capturePhotoOputput (flutter/packages#13248)
2026-10-16 okorohelijah@google.com [various] Update iOS example apps to
the 15.0 deployment target (flutter/packages#13223)
2026-10-16 36861262+QuncCccccc@users.noreply.github.com [material_ui]
Add M3E `IconButton` example (flutter/packages#13085)
2026-10-15 magder@google.com [ci] Increase deprecation check minimum to
iOS 16 (flutter/packages#13211)
2026-10-15 victor.orozco@cloudsufi.com [google_sign_in] Remove the
public iOS handleOpen helper (flutter/packages#13273)
2026-10-15 okorohelijah@google.com [google_fonts] Make the pendingFonts
test deterministic (flutter/packages#13262)
2026-10-15 48776784+mackings@users.noreply.github.com
[vector_graphics_compiler] Fix tspan transform applied twice
(flutter/packages#13129)
2026-10-15 engine-flutter-autoroll@skia.org Roll Flutter from
426be96 to 5c7e45a (21 revisions) (flutter/packages#13270)
2026-10-15 37883572+edwin-hollen@users.noreply.github.com [flutter_svg]
Add golden widget tests for SVG alpha masks (flutter/packages#13245)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD override: no changelog needed Override the check requiring CHANGELOG updates for most changes override: no versioning needed Override the check requiring version bumps for most changes p: google_fonts triage-design Should be looked at in design triage

Projects

None yet

3 participants