13

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()?

1 Answer 1

16

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes this temporarily solves the problem but it keeps happening over and over again, wheras it didn't used to happen. Having to flutter clean and refetch packages every time I want to run my tests isn't practical. There must be some underlying problem that is causing this to happen in the first place that isn't being solved.
Agree @ActionJackBarker , this was just a workaround I found and wanted to share. Don't know if this is already being looked into in the flutter repo.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.