Non-reproduceable build fail with gradle-android-test-plugin -
i'm using gradle-android-test-plugin in one of projects. on 3 of 4 machines, ./gradlew --daemon test
successful. on other fails.
the build.gradle located here, .travis.yml here here. machines have similar configurations: differences find are
- different linux kernels
- different java build names (i.e. "archlinux build 7.u55_2.4.7-1-x86_64")
after asking on project's site, recommended compare environment configurations , ask here. not know issue comes from:
- a bug in code incl. build.gradle
- an environment configuration (<-- one)
- a bug in plugin or gradle
because ./gradlew --daemon test
command shows behaviour (the other behave consistent on different pcs), don't know further. stacktrace below causes build fail:
java.lang.runtimeexception: java.lang.runtimeexception: stub! @ org.robolectric.robolectrictestrunner$2.evaluate(robolectrictestrunner.java:240) @ org.junit.runners.parentrunner.runleaf(parentrunner.java:271) @ org.junit.runners.blockjunit4classrunner.runchild(blockjunit4classrunner.java:70) @ org.junit.runners.blockjunit4classrunner.runchild(blockjunit4classrunner.java:50) @ org.junit.runners.parentrunner$3.run(parentrunner.java:238) @ org.junit.runners.parentrunner$1.schedule(parentrunner.java:63) @ org.junit.runners.parentrunner.runchildren(parentrunner.java:236) @ org.junit.runners.parentrunner.access$000(parentrunner.java:53) @ org.junit.runners.parentrunner$2.evaluate(parentrunner.java:229) @ org.robolectric.robolectrictestrunner$1.evaluate(robolectrictestrunner.java:177) @ org.junit.runners.parentrunner.run(parentrunner.java:309) @ org.gradle.api.internal.tasks.testing.junit.junittestclassexecuter.runtestclass(junittestclassexecuter.java:86) @ org.gradle.api.internal.tasks.testing.junit.junittestclassexecuter.execute(junittestclassexecuter.java:49) @ org.gradle.api.internal.tasks.testing.junit.junittestclassprocessor.processtestclass(junittestclassprocessor.java:69) @ org.gradle.api.internal.tasks.testing.suitetestclassprocessor.processtestclass(suitetestclassprocessor.java:50) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ org.gradle.messaging.dispatch.reflectiondispatch.dispatch(reflectiondispatch.java:35) @ org.gradle.messaging.dispatch.reflectiondispatch.dispatch(reflectiondispatch.java:24) @ org.gradle.messaging.dispatch.contextclassloaderdispatch.dispatch(contextclassloaderdispatch.java:32) @ org.gradle.messaging.dispatch.proxydispatchadapter$dispatchinginvocationhandler.invoke(proxydispatchadapter.java:93) @ com.sun.proxy.$proxy2.processtestclass(unknown source) @ org.gradle.api.internal.tasks.testing.worker.testworker.processtestclass(testworker.java:103) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ org.gradle.messaging.dispatch.reflectiondispatch.dispatch(reflectiondispatch.java:35) @ org.gradle.messaging.dispatch.reflectiondispatch.dispatch(reflectiondispatch.java:24) @ org.gradle.messaging.remote.internal.hub.messagehub$handler.run(messagehub.java:355) @ org.gradle.internal.concurrent.defaultexecutorfactory$stoppableexecutorimpl$1.run(defaultexecutorfactory.java:64) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:744) caused by: java.lang.runtimeexception: stub! @ android.net.uri.parse(uri.java:53) @ org.robolectric.shadows.shadowmediastore.reset(shadowmediastore.java:27) @ org.robolectric.robolectric.reset(robolectric.java:1351) @ org.robolectric.internal.paralleluniverse.resetstaticstate(paralleluniverse.java:47) @ org.robolectric.robolectrictestrunner$2.evaluate(robolectrictestrunner.java:226) @ org.junit.runners.parentrunner.runleaf(parentrunner.java:271) @ org.junit.runners.blockjunit4classrunner.runchild(blockjunit4classrunner.java:70) @ org.junit.runners.blockjunit4classrunner.runchild(blockjunit4classrunner.java:50) @ org.junit.runners.parentrunner$3.run(parentrunner.java:238) @ org.junit.runners.parentrunner$1.schedule(parentrunner.java:63) @ org.junit.runners.parentrunner.runchildren(parentrunner.java:236) @ org.junit.runners.parentrunner.access$000(parentrunner.java:53) @ org.junit.runners.parentrunner$2.evaluate(parentrunner.java:229) @ org.robolectric.robolectrictestrunner$1.evaluate(robolectrictestrunner.java:177) @ org.junit.runners.parentrunner.run(parentrunner.java:309) @ org.gradle.api.internal.tasks.testing.junit.junittestclassexecuter.runtestclass(junittestclassexecuter.java:86) @ org.gradle.api.internal.tasks.testing.junit.junittestclassexecuter.execute(junittestclassexecuter.java:49) @ org.gradle.api.internal.tasks.testing.junit.junittestclassprocessor.processtestclass(junittestclassprocessor.java:69) @ org.gradle.api.internal.tasks.testing.suitetestclassprocessor.processtestclass(suitetestclassprocessor.java:50) @ org.gradle.messaging.dispatch.reflectiondispatch.dispatch(reflectiondispatch.java:35) @ org.gradle.messaging.dispatch.reflectiondispatch.dispatch(reflectiondispatch.java:24) @ org.gradle.messaging.dispatch.contextclassloaderdispatch.dispatch(contextclassloaderdispatch.java:32) @ org.gradle.messaging.dispatch.proxydispatchadapter$dispatchinginvocationhandler.invoke(proxydispatchadapter.java:93) @ com.sun.proxy.$proxy2.processtestclass(unknown source) @ org.gradle.api.internal.tasks.testing.worker.testworker.processtestclass(testworker.java:103) ... 7 more
it thrown when following test executed.
@config(emulatesdk = 18) @runwith(robolectrictestrunner.class) public class sanitytest { @test public void sanity(){ int i=1; assertequals("insanity!", 2, i+1); } }
for completeness, java configurations below:
fail$ java -version; javac -version java version "1.7.0_55" openjdk runtime environment (icedtea 2.4.7) (archlinux build 7.u55_2.4.7-1-x86_64) openjdk 64-bit server vm (build 24.51-b03, mixed mode) javac 1.7.0_55 success1$ java -version; javac -version java version "1.7.0_51" openjdk runtime environment (icedtea 2.4.4) (suse-8.32.5-x86_64) openjdk 64-bit server vm (build 24.45-b08, mixed mode) javac 1.7.0_51 success2$ java -version; javac -version java version "1.7.0_55" openjdk runtime environment (icedtea 2.4.7) (archlinux build 7.u55_2.4.7-1-x86_64) openjdk 64-bit server vm (build 24.51-b03, mixed mode) javac 1.7.0_55 travis$ java -version java version "1.7.0_51" java(tm) se runtime environment (build 1.7.0_51-b13) java hotspot(tm) 64-bit server vm (build 24.51-b03, mixed mode) travis$ javac -version javac 1.7.0_51
i hava checked output of ./gradlew --version
did not find relevant difference:
success1 ------------------------------------------------------------ gradle 1.10 ------------------------------------------------------------ build time: 2013-12-17 09:28:15 utc build number: none revision: 36ced393628875ff15575fa03d16c1349ffe8bb6 groovy: 1.8.6 ant: apache ant(tm) version 1.9.2 compiled on july 8 2013 ivy: 2.2.0 jvm: 1.7.0_55 (oracle corporation 24.51-b03) os: linux 3.14.4-1-arch amd64 success2 ------------------------------------------------------------ gradle 1.10 ------------------------------------------------------------ build time: 2013-12-17 09:28:15 utc build number: none revision: 36ced393628875ff15575fa03d16c1349ffe8bb6 groovy: 1.8.6 ant: apache ant(tm) version 1.9.2 compiled on july 8 2013 ivy: 2.2.0 jvm: 1.7.0_55 (oracle corporation 24.51-b03) os: linux 3.14.4-1-arch amd64 fail ------------------------------------------------------------ gradle 1.10 ------------------------------------------------------------ build time: 2013-12-17 09:28:15 utc build number: none revision: 36ced393628875ff15575fa03d16c1349ffe8bb6 groovy: 1.8.6 ant: apache ant(tm) version 1.9.2 compiled on july 8 2013 ivy: 2.2.0 jvm: 1.7.0_55 (oracle corporation 24.51-b03) os: linux 3.10.40-1-manjaro amd64
i have faced problem recently, , solve problem below.
- remove ~/.m2 directory if exists
- remove ~/.gradle/cache if exists
then test work!
Comments
Post a Comment