How to find out why tests are running slow?

685 views Asked by At

We have Flutter project with a lot of widget tests. It already takes a few minutes for the tests to complete. We run them with:

flutter test

Is there any way to "profile" the tests and find bottlenecks?

1

There are 1 answers

0
Your Friend Ken On

You could scan the verbose test output. It should save timestamps for each test. This can be tedious, but could be a good start to figure out which tests are slow.

flutter test -v > test_output.txt

I agree – it would be nice if there were a "--profile" flag that generate a report for tests.