VeryGoodOpenSource / very_good_flame_game

A Very Good Flutter Starter Flame Game created by the Very Good Ventures Team πŸ¦„
https://brickhub.dev/bricks/very_good_flame_game
MIT License
85 stars 11 forks source link

fix: `flutter test` fails on Fluter 3.16.0 #132

Closed alestiago closed 12 months ago

alestiago commented 1 year ago

Description Running test fails on Flutter (3.16.0)

Steps To Reproduce

  1. Run flutter tests:

    # Run tests (from src/very_good_flame_game)
    flutter test
  2. See failures.

Logs ```txt 00:00 +0: loading /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/cubit/preload/preload_state_test.dart 00:01 +0: loading /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/cubit/preload/preload_state_test.dart 00:01 +0: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/cubit/preload/preload_state_test.dart: PreloadState initial 00:01 +1: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/cubit/preload/preload_state_test.dart: PreloadState initial 00:01 +1: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/cubit/preload/preload_state_test.dart: PreloadState progress when not started is zero 00:01 +2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/cubit/preload/preload_state_test.dart: PreloadState progress when not started is zero 00:01 +2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/cubit/preload/preload_state_test.dart: PreloadState progress after started 00:01 +3: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/cubit/preload/preload_state_test.dart: PreloadState progress after started 00:01 +3: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/cubit/preload/preload_state_test.dart: PreloadState isComplete when not started is zero 00:01 +4: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/cubit/preload/preload_state_test.dart: PreloadState isComplete when not started is zero 00:01 +4: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/cubit/preload/preload_state_test.dart: PreloadState isComplete after started 00:01 +5: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/cubit/preload/preload_state_test.dart: PreloadState isComplete after started 00:01 +5: loading /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/cubit/preload/preload_cubit_test.dart 00:01 +5: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/cubit/preload/preload_cubit_test.dart: PreloadCubit loadSequentially loads assets 00:02 +5: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/cubit/preload/preload_cubit_test.dart: PreloadCubit loadSequentially loads assets 00:02 +6: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/view/loading_page_test.dart: LoadingPage basic layout 00:02 +7: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/view/loading_page_test.dart: LoadingPage basic layout 00:02 +8: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/view/loading_page_test.dart: LoadingPage basic layout 00:02 +9: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/view/loading_page_test.dart: LoadingPage basic layout 00:02 +10: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/app/view/app_test.dart: App renders AppView 00:02 +11: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/app/view/app_test.dart: App renders AppView 00:02 +12: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/title/view/title_page_test.dart: TitlePage renders TitleView 00:02 +13: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/view/loading_page_test.dart: LoadingPage redirects after loading 00:02 +13: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/view/loading_page_test.dart: LoadingPage redirects after loading ══║ EXCEPTION CAUGHT BY FOUNDATION LIBRARY β•žβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• The following _TypeError was thrown while dispatching notifications for _History: type 'Null' is not a subtype of type 'bool' When the exception was thrown, this was the stack: #0 MockNavigator.canPop (package:mockingjay/src/mock_navigator.dart:66:7) #1 _MockNavigatorState.canPop (package:mockingjay/src/mock_navigator.dart:193:23) #2 NavigatorState._handleHistoryChanged (package:flutter/src/widgets/navigator.dart:3489:34) #3 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:433:24) #4 _History.addAll (package:flutter/src/widgets/navigator.dart:3406:7) #5 NavigatorState.restoreState (package:flutter/src/widgets/navigator.dart:3608:18) #6 RestorationMixin._doRestore (package:flutter/src/widgets/restoration.dart:924:5) #7 RestorationMixin.didChangeDependencies (package:flutter/src/widgets/restoration.dart:910:7) #8 NavigatorState.didChangeDependencies (package:flutter/src/widgets/navigator.dart:3656:11) #9 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:5620:11) #10 ComponentElement.mount (package:flutter/src/widgets/framework.dart:5447:5) ... Normal element mounting (220 frames) #230 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4326:16) #231 MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6871:36) #232 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6883:32) ... Normal element mounting (453 frames) #685 _InheritedProviderScopeElement.mount (package:provider/src/inherited_provider.dart:411:11) ... Normal element mounting (7 frames) #692 SingleChildWidgetElementMixin.mount (package:nested/nested.dart:222:11) ... Normal element mounting (7 frames) #699 SingleChildWidgetElementMixin.mount (package:nested/nested.dart:222:11) ... Normal element mounting (7 frames) #706 _NestedHookElement.mount (package:nested/nested.dart:187:11) ... Normal element mounting (7 frames) #713 SingleChildWidgetElementMixin.mount (package:nested/nested.dart:222:11) #714 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4326:16) #715 Element.updateChild (package:flutter/src/widgets/framework.dart:3831:20) #716 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16) #717 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7) #718 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5) #719 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15) #720 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16) #721 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11) #722 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7) #723 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5) #724 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15) #725 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16) #726 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7) #727 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5) #728 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15) #729 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16) #730 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7) #731 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5) #732 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15) #733 _RawViewElement._updateChild (package:flutter/src/widgets/view.dart:289:16) #734 _RawViewElement.update (package:flutter/src/widgets/view.dart:376:5) #735 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15) #736 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16) #737 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7) #738 StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5) #739 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15) #740 RootElement._rebuild (package:flutter/src/widgets/binding.dart:1334:16) #741 RootElement.update (package:flutter/src/widgets/binding.dart:1312:5) #742 RootElement.performRebuild (package:flutter/src/widgets/binding.dart:1326:7) #743 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7) #744 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2895:19) #745 AutomatedTestWidgetsFlutterBinding.drawFrame (package:flutter_test/src/binding.dart:1409:19) #746 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:457:5) #747 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1325:15) #748 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1255:9) #749 AutomatedTestWidgetsFlutterBinding.pump. (package:flutter_test/src/binding.dart:1264:9) #752 TestAsyncUtils.guard (package:flutter_test/src/test_async_utils.dart:71:41) #753 AutomatedTestWidgetsFlutterBinding.pump (package:flutter_test/src/binding.dart:1251:27) #754 WidgetTester.pumpWidget. (package:flutter_test/src/widget_tester.dart:578:22) #757 TestAsyncUtils.guard (package:flutter_test/src/test_async_utils.dart:71:41) #758 WidgetTester.pumpWidget (package:flutter_test/src/widget_tester.dart:575:27) #759 PumpApp.pumpApp (file:///Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/helpers/pump_app.dart:18:12) #760 main.. (file:///Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/view/loading_page_test.dart:86:20) #761 testWidgets.. (package:flutter_test/src/widget_tester.dart:168:29) #762 TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:1013:5) (elided 5 frames from dart:async and package:stack_trace) The _History sending notification was: [Instance of '_RouteEntry'] ════════════════════════════════════════════════════════════════════════════════════════════════════ 00:02 +13 -1: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/view/loading_page_test.dart: LoadingPage redirects after loading [E] Test failed. See exception logs above. The test description was: redirects after loading To run this test again: /Users/alestiago/Developer/flutter/flutter/bin/cache/dart-sdk/bin/dart test /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/loading/view/loading_page_test.dart -p vm --plain-name 'LoadingPage redirects after loading' 00:02 +14 -1: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/title/view/title_page_test.dart: TitleView renders start button 00:02 +14 -1: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/title/view/title_page_test.dart: TitleView starts the game when start button is tapped 00:03 +14 -1: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/title/view/title_page_test.dart: TitleView starts the game when start button is tapped 00:03 +14 -1: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/title/view/title_page_test.dart: TitleView starts the game when start button is tapped ══║ EXCEPTION CAUGHT BY FOUNDATION LIBRARY β•žβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• The following _TypeError was thrown while dispatching notifications for _History: type 'Null' is not a subtype of type 'bool' When the exception was thrown, this was the stack: #0 MockNavigator.canPop (package:mockingjay/src/mock_navigator.dart:66:7) #1 _MockNavigatorState.canPop (package:mockingjay/src/mock_navigator.dart:193:23) #2 NavigatorState._handleHistoryChanged (package:flutter/src/widgets/navigator.dart:3489:34) #3 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:433:24) #4 _History.addAll (package:flutter/src/widgets/navigator.dart:3406:7) #5 NavigatorState.restoreState (package:flutter/src/widgets/navigator.dart:3608:18) #6 RestorationMixin._doRestore (package:flutter/src/widgets/restoration.dart:924:5) #7 RestorationMixin.didChangeDependencies (package:flutter/src/widgets/restoration.dart:910:7) #8 NavigatorState.didChangeDependencies (package:flutter/src/widgets/navigator.dart:3656:11) #9 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:5620:11) #10 ComponentElement.mount (package:flutter/src/widgets/framework.dart:5447:5) ... Normal element mounting (220 frames) #230 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4326:16) #231 MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6871:36) #232 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6883:32) ... Normal element mounting (453 frames) #685 _InheritedProviderScopeElement.mount (package:provider/src/inherited_provider.dart:411:11) ... Normal element mounting (7 frames) #692 SingleChildWidgetElementMixin.mount (package:nested/nested.dart:222:11) ... Normal element mounting (7 frames) #699 SingleChildWidgetElementMixin.mount (package:nested/nested.dart:222:11) ... Normal element mounting (7 frames) #706 _NestedHookElement.mount (package:nested/nested.dart:187:11) ... Normal element mounting (7 frames) #713 SingleChildWidgetElementMixin.mount (package:nested/nested.dart:222:11) #714 Element.inflateWidget (package:flutter/src/widgets/framework.dart:4326:16) #715 Element.updateChild (package:flutter/src/widgets/framework.dart:3831:20) #716 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16) #717 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7) #718 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5) #719 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15) #720 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16) #721 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11) #722 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7) #723 StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5) #724 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15) #725 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16) #726 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7) #727 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5) #728 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15) #729 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16) #730 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7) #731 ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5) #732 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15) #733 _RawViewElement._updateChild (package:flutter/src/widgets/view.dart:289:16) #734 _RawViewElement.update (package:flutter/src/widgets/view.dart:376:5) #735 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15) #736 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16) #737 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7) #738 StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5) #739 Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15) #740 RootElement._rebuild (package:flutter/src/widgets/binding.dart:1334:16) #741 RootElement.update (package:flutter/src/widgets/binding.dart:1312:5) #742 RootElement.performRebuild (package:flutter/src/widgets/binding.dart:1326:7) #743 Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7) #744 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2895:19) #745 AutomatedTestWidgetsFlutterBinding.drawFrame (package:flutter_test/src/binding.dart:1409:19) #746 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:457:5) #747 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1325:15) #748 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1255:9) #749 AutomatedTestWidgetsFlutterBinding.pump. (package:flutter_test/src/binding.dart:1264:9) #752 TestAsyncUtils.guard (package:flutter_test/src/test_async_utils.dart:71:41) #753 AutomatedTestWidgetsFlutterBinding.pump (package:flutter_test/src/binding.dart:1251:27) #754 WidgetTester.pumpWidget. (package:flutter_test/src/widget_tester.dart:578:22) #757 TestAsyncUtils.guard (package:flutter_test/src/test_async_utils.dart:71:41) #758 WidgetTester.pumpWidget (package:flutter_test/src/widget_tester.dart:575:27) #759 PumpApp.pumpApp (file:///Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/helpers/pump_app.dart:18:12) #760 main.. (file:///Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/title/view/title_page_test.dart:30:20) #761 testWidgets.. (package:flutter_test/src/widget_tester.dart:168:29) #762 TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:1013:5) (elided 5 frames from dart:async and package:stack_trace) The _History sending notification was: [Instance of '_RouteEntry'] ════════════════════════════════════════════════════════════════════════════════════════════════════ 00:03 +14 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/title/view/title_page_test.dart: TitleView starts the game when start button is tapped [E] Test failed. See exception logs above. The test description was: starts the game when start button is tapped To run this test again: /Users/alestiago/Developer/flutter/flutter/bin/cache/dart-sdk/bin/dart test /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/title/view/title_page_test.dart -p vm --plain-name 'TitleView starts the game when start button is tapped' 00:03 +14 -2: loading /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/components/counter_component_test.dart 00:03 +14 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/components/counter_component_test.dart: CounterComponent has all components 00:03 +15 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/components/counter_component_test.dart: CounterComponent has all components 00:03 +15 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/components/counter_component_test.dart: CounterComponent changes text count correctly 00:03 +16 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/components/counter_component_test.dart: CounterComponent changes text count correctly 00:03 +16 -2: loading /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/view/game_page_test.dart 00:03 +16 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/view/game_page_test.dart: (setUpAll) 00:03 +16 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/view/game_page_test.dart: GamePage (setUpAll) 00:03 +16 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/view/game_page_test.dart: GamePage is routable 00:03 +17 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/view/game_page_test.dart: GamePage is routable 00:03 +18 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/view/game_page_test.dart: GamePage is routable 00:03 +19 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/view/game_page_test.dart: GamePage is routable 00:03 +20 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/view/game_page_test.dart: GamePage is routable 00:03 +21 -2: ... TappingBehavior when tapped, starts playing the animation 00:03 +22 -2: ... TappingBehavior when tapped, starts playing the animation 00:03 +23 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/view/game_page_test.dart: GameView toggles mute button correctly 00:03 +24 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/view/game_page_test.dart: GameView toggles mute button correctly 00:03 +24 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/view/game_page_test.dart: GameView calls correct method based on state 00:03 +25 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/view/game_page_test.dart: GameView calls correct method based on state 00:03 +25 -2: /Users/alestiago/Developer/workspace/oss/very_good_flame_game/src/very_good_flame_game/test/game/view/game_page_test.dart: (tearDownAll) 00:03 +25 -2: Some tests failed. ```

Expected Behavior All test should pass on the latest Flutter version (ie 3.16.0)

Additional Context

renancaraujo commented 12 months ago

I think this is closed