performance-samples icon indicating copy to clipboard operation
performance-samples copied to clipboard

Failing tests in the Macrobenchmark sample

Open StylingAndroid opened this issue 1 year ago • 0 comments

I am trying to run the benchmarks on the Macrobenchmark sample and some of the tests are failing. I am using the unaltered HEAD of the main branch, and executing ./gradlew :macrobenchmark:connectedBenchmarkReleaseAndroidTest. All of the tests in ClickLatencyBenchmark are failing with a similar error:

java.lang.IllegalArgumentException: Unable to read any metrics during benchmark (metric list: [androidx.benchmark.macro.TraceSectionMetric@390ebd6]).
Check that you're performing the operations to be measured. For example, if
using StartupTimingMetric, are you starting an activity for the specified package
in the measure block?
at androidx.benchmark.macro.MacrobenchmarkKt.macrobenchmark(Macrobenchmark.kt:342)
at androidx.benchmark.macro.MacrobenchmarkKt.macrobenchmarkWithStartupMode(Macrobenchmark.kt:422)
at androidx.benchmark.macro.junit4.MacrobenchmarkRule.measureRepeated(MacrobenchmarkRule.kt:107)
at com.example.macrobenchmark.benchmark.clickslatency.ClickLatencyBenchmark.composeLazyColumnClick(ClickLatencyBenchmark.kt:95)

All of the other tests are working fine.

This is on a Pixel 6 Pro running Android 14.

I have tried this on multiple computers, and used multiple different test devices, but always get the same failures.

StylingAndroid avatar Jan 12 '24 15:01 StylingAndroid