Repository: flutter
Issue: [flutter_svg] SvgPicture.network test succeeds erroneously, log shows failure.
Labels: package,p: flutter_svg

_Imported from https://github.com/dnfield/flutter_svg/issues/114_

Original report by @acherkashyn on Feb 12, 2019

Seen on flutter_svg commit 283a10240cd3331af7ebde31333e4afee83ae2bc:

Steps:
* run "SvgPicture.network" test. Observe log

Result:
* Test passes, but there's an exception logged:

```
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following TestFailure object was thrown running a test (but after the test had completed):
  Expected: one widget whose rasterized image matches golden image
  "golden_widget/flutter_logo.network.png"
  Actual: ?:<zero widgets with key [GlobalKey#d17e0] (ignoring offstage widgets)>
   Which: does not match

When the exception was thrown, this was the stack:
#0      fail (package:test_api/src/frontend/expect.dart:160:30)
#1      _expect.<anonymous closure> (package:test_api/src/frontend/expect.dart:135:9)
#24     _MatchesGoldenFile.matchAsync.<anonymous closure> (package:flutter_test/src/matchers.dart)
<asynchronous suspension>
#25     AutomatedTestWidgetsFlutterBinding.runAsync.<anonymous closure> (package:flutter_test/src/binding.dart:755:22)
#28     AutomatedTestWidgetsFlutterBinding.runAsync (package:flutter_test/src/binding.dart:753:26)
#29     _MatchesGoldenFile.matchAsync (package:flutter_test/src/matchers.dart:1652:20)
#31     _MatchesGoldenFile.matchAsync (package:flutter_test/src/matchers.dart:1634:28)
#32     _expect (package:test_api/src/frontend/expect.dart:122:26)
#33     expectLater (package:test_api/src/frontend/expect.dart:76:5)
#34     expectLater (package:flutter_test/src/widget_tester.dart:189:10)
#35     _checkWidgetAndGolden (file:///Users/acherkashyn/Documents/workspace/source/flutter_svg/test/widget_svg_test.dart:17:9)
#37     _checkWidgetAndGolden (file:///Users/acherkashyn/Documents/workspace/source/flutter_svg/test/widget_svg_test.dart:13:35)
#38     main.<anonymous closure>.<anonymous closure> (file:///Users/acherkashyn/Documents/workspace/source/flutter_svg/test/widget_svg_test.dart:204:13)
#52     AutomatedTestWidgetsFlutterBinding.asyncBarrier (package:flutter_test/src/binding.dart:921:23)
#53     TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:567:5)
#74     AutomatedTestWidgetsFlutterBinding.runTest.<anonymous closure> (package:flutter_test/src/binding.dart:909:17)
#76     AutomatedTestWidgetsFlutterBinding.runTest.<anonymous closure> (package:flutter_test/src/binding.dart:897:35)
(elided 75 frames from class _FakeAsync, package dart:async, and package stack_trace)
════════════════════════════════════════════════════════════════════════════════════════════════════
```

Expected:
* Test should fail

---
Comment by @dnfield on Feb 12, 2019
You're very likely getting this because you're not running on master.  Unfortunately, I have to pick some version of Flutter to keep goldens up to date with.  Skia ends up introducing subtle anti-aliasing changes every so often that break the tests.  I end up regenerating them off of master and figure it will eventually be right.

Are you sure the test is passing though?  If I run the test it seems ok.

---
Comment by @acherkashyn on Feb 13, 2019
@dnfield I'm running the test in Android Studio on a Mac computer, it shows green/passed. I've seen goldens not evaluating properly if you run tests on a different platform, so that is understandable if you've generated them on linux or windows. But the test passes, even though this failure is printed in log, so I think the setup is broken somehow, maybe expectLater() takes longer to complete, and the test doesn't wait for that.

---
Comment by @dnfield on Feb 13, 2019
Ahh ok, I'll try to take a look when I can