-
Notifications
You must be signed in to change notification settings - Fork 333
Description
Description
If there is a class in the classpath that will not load due to changes in the underlying system (causing a LinkageError), the test runner process crashes when scanning the classpath.
I believe this can be fixed by adjusting the logic around https://github.com/android/android-test/blob/master/runner/android_junit_runner/java/androidx/test/internal/runner/TestLoader.java#L80 to catch LinkageError and report it similarly to ClassNotFoundException, though I don't know if you want to report it identically.
This was originally reported at google/conscrypt#713.
Steps to Reproduce
Include a class that cannot load on the classpath (eg, a class that overrides a final method). The class need not be a test class or referenced by any other class.
Expected Results
The test run should ignore the unloadable class and test the loadable classes.
Actual Results
The test runner crashes.
AndroidX Test and Android OS Versions
All versions, as far as I can tell.
Link to a public git repo demonstrating the problem:
Using an Android 10 device:
git clone https://github.com/flooey/okhttp
# Set ANDROID_SDK_ROOT appropriately
cd okhttp
./gradlew android-test:connectedCheck