Assigned
Status Update
Comments
pu...@gmail.com <pu...@gmail.com> #2
When I run Macrobenchmark via the `connectedCheck` target with info logs on, I can see the arg being set:
```
INFO: Configuring Android Instrumentation driver: android_instrumentation_runtime {
instrumentation_info {
...
args_map {
key: "androidx.benchmark.suppressErrors"
value: "DEBUGGABLE"
}
}
}
```
Attempted to pass the flag via the `-e` option to the `instrument` command of ADB, but no change to error output:
```
$ adb shell am instrument -w com.ring.benchmark/androidx.test.runner.AndroidJUnitRunner -e androidx.benchmark.suppressErrors DEBUGGABLE
...
ERROR: Benchmark Target is Debuggable
```
```
INFO: Configuring Android Instrumentation driver: android_instrumentation_runtime {
instrumentation_info {
...
args_map {
key: "androidx.benchmark.suppressErrors"
value: "DEBUGGABLE"
}
}
}
```
Attempted to pass the flag via the `-e` option to the `instrument` command of ADB, but no change to error output:
```
$ adb shell am instrument -w com.ring.benchmark/androidx.test.runner.AndroidJUnitRunner -e androidx.benchmark.suppressErrors DEBUGGABLE
...
ERROR: Benchmark Target is Debuggable
```
cc...@google.com <cc...@google.com> #3
Are you seeing a line like the following? :
ERRORS (not suppressed): ...
WARNINGS (suppressed): ...
Can you try suppressing other errors, does that work? E.g. run the macrobenchmark on an emulator, which should require adding "EMULATOR" to the suppression list, and show it as a suppressed warning.
Description
Version: androidx.benchmark:benchmark-macro-junit4:1.2.4
When running a benchmark, the system may restore data from the app that was backuped in a previous run (for example if developer runs the release version of the app). Thus the app being benchmarked may not run a clean state (what it would be for a user installing the app for the very first time).
This can be trivially worked-around by setting
android:backup=false
in the app Manifest (this will also disable backup restore on app install), but it is not super practical as it is a manual operation.It would be best if this was handled by
androidx.benchmark
either:android:backup=false
pm clear <package>
just after it installs it and prior running it