Assigned
Status Update
Comments
cc...@google.com <cc...@google.com> #2
Why do you want app data to be cleared between each test?
Can you consider adding that data clearing yourself, explicitly, when you want it to be cleared? (sending a broadcast, shell command, launching a benchmark-variant-only activity that does this)
Macrobenchmark's approach of reinstalling the app is fairly slow, because it's the only way to clear compilation state on Android 13 and below, but that's the main goal of that operation. Clearing app data is an unintended side effect.
Description
Component used: androidx.benchmark:benchmark-macro-junit4 Version used: 1.2.0-alpha15 Devices/Android versions reproduced on: Fairphone Phone 3, Android 13
We recently updated our benchmark library to the version above and we're experimenting with Dry run mode, using "androidx.benchmark.dryRunMode.enable" to "true" in gradle. We discovered that the app doesn't get uninstalled/data cleared between tests. Adding "clearPackageData" to "true" to testInstrumentationRunnerArguments doesn't change anything. This only happens with dry mode however.
If this is a bug in the library, we would appreciate if you could attach: