Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error running tests with flutter : "Failed to load "_test.dart": Shell subprocess ended cleanly. Did main() call exit()?"

Whenever I add new tests to my codebase I encounter the aforementioned error message while running them.

package:flutter_tools/src/test/flutter_tester_device.dart 224:73  FlutterTesterTestDevice.finished
===== asynchronous gap ===========================
dart:async/future.dart                                            Future.any.onValue
Failed to load "app/test/club/club_section_test.dart": Shell subprocess ended cleanly. Did main() call exit()?

like image 854
croxx5f Avatar asked Feb 03 '23 13:02

croxx5f


1 Answers

TLDR

flutter clean && flutter packages get

Workaround

Well it seems that for some reason flutter is caching some data that becomes stale, you can easily get the test back by running:

flutter clean 

Which "Delete the build/ and .dart_tool/ directories" and then:

flutter packages get

To rebuild those directories and download dependencies.

like image 132
croxx5f Avatar answered Feb 08 '23 15:02

croxx5f