Show 'started' messages, explain how to debug hangs in the Android JUnit tests (#163242)

There is more work to do, i.e.
https://github.com/flutter/flutter/issues/163239, to make this a better
experience, but better than nothing.
This commit is contained in:
Matan Lurey 2025-02-13 14:50:09 -08:00 committed by GitHub
parent f3bdcbda58
commit 9ffdd3a0ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 4 deletions

View File

@ -51,7 +51,15 @@ The easiest way (though not the quickest) is to use `run_tests.py`:
./testing/run_tests.py --type java --android-variant android_debug_unopt_arm64
```
You may also be able to run the tests directly from Android Studio.
> [!TIP]
> Trying to debug tests or timeouts/hangs?
>
> Run the tests directly from Android Studio, or [set `maxParallelForks` to `1`](https://github.com/flutter/flutter/blob/1cd3ab16ca1cba35e187ae75063fce0915985b94/engine/src/flutter/shell/platform/android/test_runner/build.gradle#L55):
>
> ```diff
> + maxParallelForks availableProcessors // The CI bot has 8 CPUs.
> - maxParallelForks 1
> ```
### Integration tests
@ -150,6 +158,7 @@ completion:
![Example](https://github.com/flutter/flutter/assets/168174/8a75dd27-66e1-4c4f-88af-667a73b909b6)
> [!NOTE]
>
> `--compile-commands-dir` must point to an Android build output:
>
> ```jsonc
@ -220,7 +229,8 @@ code completion in the `io/flutter` and `test/io/flutter` folders. For example,
![Example](https://github.com/flutter/flutter/assets/168174/387550d4-eab7-4097-9da3-7713a6ec4da7)
To get code coverage displayed in line: go to the test class you wish to run and
1. Right click > Modify Run Configuration...,
1. Right click > Modify Run Configuration...,
2. In the window that pops up click Modify options > Specify classes
and packages (under "code coverage").
and packages (under "code coverage").
3. In the new box that appears at the bottom of the window, click the + > Add package, and then add `io.flutter.*`.

View File

@ -54,7 +54,7 @@ android {
maxHeapSize "8g"
maxParallelForks availableProcessors // The CI bot has 8 CPUs.
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
events "started", "passed", "skipped", "failed", "standardOut", "standardError"
exceptionFormat "full"
showStackTraces true
showStandardStreams true