Skip to content

Conversation

dnfield
Copy link
Contributor

@dnfield dnfield commented Nov 10, 2022

This makes it possible to load an asset without actually turning the event loop. This is importnat because our FakeAsync zones may cause people to sprinkle in extra pumpAndSettles in when running tests that load assets, which is undesirable.

While I was here I noticed some unnecessary dynamic usage in SynchronousFuture.

This makes it possible to load an asset without actually turning
the event loop. This is importnat because our FakeAsync zones
may cause people to sprinkle in extra pumpAndSettles in when
running tests that load assets, which is undesirable.
@flutter-dashboard flutter-dashboard bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. labels Nov 10, 2022
@dnfield
Copy link
Contributor Author

dnfield commented Nov 11, 2022

I came across this because I'm working on rolling a new version of flutter_svg into Google's monorepo. Tests in there that previously worked because of google-specific magic now are missing assets because the rewrite assumes you can do this kind of thing synchronously in a test.

I'd like to get rid of all flutter_svg specific magic from test harnesses if possible.

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM (but not to CI)

@jonahwilliams
Copy link
Contributor

I think if we can stick this change, i can delete the fake asset manager entirely and use the real one. Will need to experiment on my own

Copy link
Contributor

@pdblasi-google pdblasi-google left a comment

Choose a reason for hiding this comment

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

LGTM

@dnfield
Copy link
Contributor Author

dnfield commented Nov 11, 2022

hah, I was wondering if that ! was safe and now know it wasn't. Cool. I'll fix it.

@dnfield dnfield added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 11, 2022
@auto-submit auto-submit bot merged commit 88e49ed into flutter:master Nov 11, 2022
@dnfield dnfield deleted the sync_asset branch November 11, 2022 04:20
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Nov 11, 2022
dnfield added a commit that referenced this pull request Nov 11, 2022
auto-submit bot pushed a commit to flutter/plugins that referenced this pull request Nov 11, 2022
* bdcacbf 1c1ad0e72 Roll Fuchsia Linux SDK from RNSA2Wp1MObtc7OHy... to mduclAELKkftJ-fwI... (flutter/engine#37495) (flutter/flutter#115088)

* ca61652 Roll ios-deploy iOS artifact (flutter/flutter#115042)

* b31b9dc 057c53a05 [Impeller] Remove duplicate code in 'TiledTextureContents' (flutter/engine#37492) (flutter/flutter#115093)

* 19b351b f467eee51 Turned on performance-move-const-arg everywhere. (flutter/engine#37482) (flutter/flutter#115095)

* 5a60045 Reland: Adds support for the Material Badge widget, BadgeTheme, BadgeThemeData (#114560) (flutter/flutter#115002)

* 09a4f23 Prevent tests from producing dill files alongside the test file (flutter/flutter#115075)

* 1f891a0 Fix `RangeSlider` semantics node size (flutter/flutter#114999)

* c1ceda4 Include stdout in codesign failure output (flutter/flutter#115115)

* 2e432ec chore: enable Flutter Android workflow on aarch64 (flutter/flutter#113829)

* ad72a45 12dabe83d Felt analyze (flutter/engine#37481) (flutter/flutter#115102)

* 4e7dbef Explicitly call out documentation links in "flutter create" (flutter/flutter#114181)

* d413081 Fix shrinkwrap on animated list (flutter/flutter#115104)

* bd00a93 Roll Flutter Engine from 12dabe83da19 to 4cb9c1e00a84 (5 revisions) (flutter/flutter#115118)

* 8858c17 Roll Flutter Engine from 4cb9c1e00a84 to 30e2cedfa2ac (2 revisions) (flutter/flutter#115122)

* 0f2f4b8 Roll Flutter Engine from 30e2cedfa2ac to cae1716611a4 (2 revisions) (flutter/flutter#115124)

* c6561e6 53cfb94c5 Roll Skia from 65b60707772d to b50a2f714837 (46 revisions) (flutter/engine#37501) (flutter/flutter#115128)

* 6e89042 0721c860e [Impeller] null check samplers (flutter/engine#37489) (flutter/flutter#115132)

* 88e49ed Load assets in flutter_test without turning event loop. (flutter/flutter#115123)

* f997281 Roll Flutter Engine from 0721c860e2c3 to cb78576e5fec (3 revisions) (flutter/flutter#115134)

* 0d081f9 Roll Flutter Engine from cb78576e5fec to a41712cec63a (2 revisions) (flutter/flutter#115135)

* 83cda7e 19ead2834 Roll Fuchsia Linux SDK from mduclAELKkftJ-fwI... to R3L54Ma3VT2TQ6RpI... (flutter/engine#37513) (flutter/flutter#115139)

* c021d91 [flutter_tools] support github reporter (flutter/flutter#115137)

* 413bb21 e32fc0044 Roll Skia from b50f741ef341 to 77620568f467 (5 revisions) (flutter/engine#37514) (flutter/flutter#115142)

* 098aac7 7326e5b33 Roll Dart SDK from 3a022103e91d to 1e37edb1f6c1 (1 revision) (flutter/engine#37515) (flutter/flutter#115145)
dnfield added a commit that referenced this pull request Nov 11, 2022
stuartmorgan-g pushed a commit to flutter/packages that referenced this pull request Nov 11, 2022
* 19b351b f467eee51 Turned on performance-move-const-arg everywhere. (flutter/engine#37482) (flutter/flutter#115095)

* 5a60045 Reland: Adds support for the Material Badge widget, BadgeTheme, BadgeThemeData (#114560) (flutter/flutter#115002)

* 09a4f23 Prevent tests from producing dill files alongside the test file (flutter/flutter#115075)

* 1f891a0 Fix `RangeSlider` semantics node size (flutter/flutter#114999)

* c1ceda4 Include stdout in codesign failure output (flutter/flutter#115115)

* 2e432ec chore: enable Flutter Android workflow on aarch64 (flutter/flutter#113829)

* ad72a45 12dabe83d Felt analyze (flutter/engine#37481) (flutter/flutter#115102)

* 4e7dbef Explicitly call out documentation links in "flutter create" (flutter/flutter#114181)

* d413081 Fix shrinkwrap on animated list (flutter/flutter#115104)

* bd00a93 Roll Flutter Engine from 12dabe83da19 to 4cb9c1e00a84 (5 revisions) (flutter/flutter#115118)

* 8858c17 Roll Flutter Engine from 4cb9c1e00a84 to 30e2cedfa2ac (2 revisions) (flutter/flutter#115122)

* 0f2f4b8 Roll Flutter Engine from 30e2cedfa2ac to cae1716611a4 (2 revisions) (flutter/flutter#115124)

* c6561e6 53cfb94c5 Roll Skia from 65b60707772d to b50a2f714837 (46 revisions) (flutter/engine#37501) (flutter/flutter#115128)

* 6e89042 0721c860e [Impeller] null check samplers (flutter/engine#37489) (flutter/flutter#115132)

* 88e49ed Load assets in flutter_test without turning event loop. (flutter/flutter#115123)

* f997281 Roll Flutter Engine from 0721c860e2c3 to cb78576e5fec (3 revisions) (flutter/flutter#115134)

* 0d081f9 Roll Flutter Engine from cb78576e5fec to a41712cec63a (2 revisions) (flutter/flutter#115135)

* 83cda7e 19ead2834 Roll Fuchsia Linux SDK from mduclAELKkftJ-fwI... to R3L54Ma3VT2TQ6RpI... (flutter/engine#37513) (flutter/flutter#115139)

* c021d91 [flutter_tools] support github reporter (flutter/flutter#115137)

* 413bb21 e32fc0044 Roll Skia from b50f741ef341 to 77620568f467 (5 revisions) (flutter/engine#37514) (flutter/flutter#115142)

* 098aac7 7326e5b33 Roll Dart SDK from 3a022103e91d to 1e37edb1f6c1 (1 revision) (flutter/engine#37515) (flutter/flutter#115145)
dnfield added a commit that referenced this pull request Nov 11, 2022
dnfield added a commit to dnfield/flutter that referenced this pull request Nov 11, 2022
auto-submit bot pushed a commit that referenced this pull request Nov 12, 2022
…nousFuture usage in test assets (#115173)

* Make FutureBuilder handle SynchronousFuture correctly

* Reland  "Load assets in flutter_test without turning event loop. (#115123)" (#115156)"

This reverts commit 3895786.
adam-harwood pushed a commit to adam-harwood/flutter_plugins that referenced this pull request Nov 21, 2022
* bdcacbf 1c1ad0e72 Roll Fuchsia Linux SDK from RNSA2Wp1MObtc7OHy... to mduclAELKkftJ-fwI... (flutter/engine#37495) (flutter/flutter#115088)

* ca61652 Roll ios-deploy iOS artifact (flutter/flutter#115042)

* b31b9dc 057c53a05 [Impeller] Remove duplicate code in 'TiledTextureContents' (flutter/engine#37492) (flutter/flutter#115093)

* 19b351b f467eee51 Turned on performance-move-const-arg everywhere. (flutter/engine#37482) (flutter/flutter#115095)

* 5a60045 Reland: Adds support for the Material Badge widget, BadgeTheme, BadgeThemeData (#114560) (flutter/flutter#115002)

* 09a4f23 Prevent tests from producing dill files alongside the test file (flutter/flutter#115075)

* 1f891a0 Fix `RangeSlider` semantics node size (flutter/flutter#114999)

* c1ceda4 Include stdout in codesign failure output (flutter/flutter#115115)

* 2e432ec chore: enable Flutter Android workflow on aarch64 (flutter/flutter#113829)

* ad72a45 12dabe83d Felt analyze (flutter/engine#37481) (flutter/flutter#115102)

* 4e7dbef Explicitly call out documentation links in "flutter create" (flutter/flutter#114181)

* d413081 Fix shrinkwrap on animated list (flutter/flutter#115104)

* bd00a93 Roll Flutter Engine from 12dabe83da19 to 4cb9c1e00a84 (5 revisions) (flutter/flutter#115118)

* 8858c17 Roll Flutter Engine from 4cb9c1e00a84 to 30e2cedfa2ac (2 revisions) (flutter/flutter#115122)

* 0f2f4b8 Roll Flutter Engine from 30e2cedfa2ac to cae1716611a4 (2 revisions) (flutter/flutter#115124)

* c6561e6 53cfb94c5 Roll Skia from 65b60707772d to b50a2f714837 (46 revisions) (flutter/engine#37501) (flutter/flutter#115128)

* 6e89042 0721c860e [Impeller] null check samplers (flutter/engine#37489) (flutter/flutter#115132)

* 88e49ed Load assets in flutter_test without turning event loop. (flutter/flutter#115123)

* f997281 Roll Flutter Engine from 0721c860e2c3 to cb78576e5fec (3 revisions) (flutter/flutter#115134)

* 0d081f9 Roll Flutter Engine from cb78576e5fec to a41712cec63a (2 revisions) (flutter/flutter#115135)

* 83cda7e 19ead2834 Roll Fuchsia Linux SDK from mduclAELKkftJ-fwI... to R3L54Ma3VT2TQ6RpI... (flutter/engine#37513) (flutter/flutter#115139)

* c021d91 [flutter_tools] support github reporter (flutter/flutter#115137)

* 413bb21 e32fc0044 Roll Skia from b50f741ef341 to 77620568f467 (5 revisions) (flutter/engine#37514) (flutter/flutter#115142)

* 098aac7 7326e5b33 Roll Dart SDK from 3a022103e91d to 1e37edb1f6c1 (1 revision) (flutter/engine#37515) (flutter/flutter#115145)
shogohida pushed a commit to shogohida/flutter that referenced this pull request Dec 7, 2022
* Load assets in flutter_test without turning event loop.

This makes it possible to load an asset without actually turning
the event loop. This is importnat because our FakeAsync zones
may cause people to sprinkle in extra pumpAndSettles in when
running tests that load assets, which is undesirable.

* fix null checking
shogohida pushed a commit to shogohida/flutter that referenced this pull request Dec 7, 2022
shogohida pushed a commit to shogohida/flutter that referenced this pull request Dec 7, 2022
…nousFuture usage in test assets (flutter#115173)

* Make FutureBuilder handle SynchronousFuture correctly

* Reland  "Load assets in flutter_test without turning event loop. (flutter#115123)" (flutter#115156)"

This reverts commit 3895786.
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
* Load assets in flutter_test without turning event loop.

This makes it possible to load an asset without actually turning
the event loop. This is importnat because our FakeAsync zones
may cause people to sprinkle in extra pumpAndSettles in when
running tests that load assets, which is undesirable.

* fix null checking
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
…nousFuture usage in test assets (flutter#115173)

* Make FutureBuilder handle SynchronousFuture correctly

* Reland  "Load assets in flutter_test without turning event loop. (flutter#115123)" (flutter#115156)"

This reverts commit 3895786.
mauricioluz pushed a commit to mauricioluz/plugins that referenced this pull request Jan 26, 2023
* bdcacbf 1c1ad0e72 Roll Fuchsia Linux SDK from RNSA2Wp1MObtc7OHy... to mduclAELKkftJ-fwI... (flutter/engine#37495) (flutter/flutter#115088)

* ca61652 Roll ios-deploy iOS artifact (flutter/flutter#115042)

* b31b9dc 057c53a05 [Impeller] Remove duplicate code in 'TiledTextureContents' (flutter/engine#37492) (flutter/flutter#115093)

* 19b351b f467eee51 Turned on performance-move-const-arg everywhere. (flutter/engine#37482) (flutter/flutter#115095)

* 5a60045 Reland: Adds support for the Material Badge widget, BadgeTheme, BadgeThemeData (#114560) (flutter/flutter#115002)

* 09a4f23 Prevent tests from producing dill files alongside the test file (flutter/flutter#115075)

* 1f891a0 Fix `RangeSlider` semantics node size (flutter/flutter#114999)

* c1ceda4 Include stdout in codesign failure output (flutter/flutter#115115)

* 2e432ec chore: enable Flutter Android workflow on aarch64 (flutter/flutter#113829)

* ad72a45 12dabe83d Felt analyze (flutter/engine#37481) (flutter/flutter#115102)

* 4e7dbef Explicitly call out documentation links in "flutter create" (flutter/flutter#114181)

* d413081 Fix shrinkwrap on animated list (flutter/flutter#115104)

* bd00a93 Roll Flutter Engine from 12dabe83da19 to 4cb9c1e00a84 (5 revisions) (flutter/flutter#115118)

* 8858c17 Roll Flutter Engine from 4cb9c1e00a84 to 30e2cedfa2ac (2 revisions) (flutter/flutter#115122)

* 0f2f4b8 Roll Flutter Engine from 30e2cedfa2ac to cae1716611a4 (2 revisions) (flutter/flutter#115124)

* c6561e6 53cfb94c5 Roll Skia from 65b60707772d to b50a2f714837 (46 revisions) (flutter/engine#37501) (flutter/flutter#115128)

* 6e89042 0721c860e [Impeller] null check samplers (flutter/engine#37489) (flutter/flutter#115132)

* 88e49ed Load assets in flutter_test without turning event loop. (flutter/flutter#115123)

* f997281 Roll Flutter Engine from 0721c860e2c3 to cb78576e5fec (3 revisions) (flutter/flutter#115134)

* 0d081f9 Roll Flutter Engine from cb78576e5fec to a41712cec63a (2 revisions) (flutter/flutter#115135)

* 83cda7e 19ead2834 Roll Fuchsia Linux SDK from mduclAELKkftJ-fwI... to R3L54Ma3VT2TQ6RpI... (flutter/engine#37513) (flutter/flutter#115139)

* c021d91 [flutter_tools] support github reporter (flutter/flutter#115137)

* 413bb21 e32fc0044 Roll Skia from b50f741ef341 to 77620568f467 (5 revisions) (flutter/engine#37514) (flutter/flutter#115142)

* 098aac7 7326e5b33 Roll Dart SDK from 3a022103e91d to 1e37edb1f6c1 (1 revision) (flutter/engine#37515) (flutter/flutter#115145)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: tests "flutter test", flutter_test, or one of our tests autosubmit Merge PR when tree becomes green via auto submit App framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants