Repository navigation
Commit 437a0ff
authored
[google_fonts] Make the pendingFonts test deterministic (flutter#13262)
`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 `expect`s 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 flutter#13223
## Pre-Review Checklist
[^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.1 parent 293b18c commit 437a0ff
1 file changed
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
| |||
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
| 20 | + | |
| 21 | + | |
15 | 22 | | |
16 | 23 | | |
17 | 24 | | |
| |||
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
30 | 50 | | |
31 | 51 | | |
32 | 52 | | |
| |||
56 | 76 | | |
57 | 77 | | |
58 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
59 | 89 | | |
60 | 90 | | |
61 | 91 | | |
| |||
0 commit comments