trellis-ldp / trellis

Trellis is a platform for building scalable Linked Data applications
https://www.trellisldp.org
Apache License 2.0
105 stars 21 forks source link

Build failing at OSGi test #259

Closed ajs6f closed 5 years ago

ajs6f commented 5 years ago

At commit efd43cdba7349888801da5165b4f5a4d7046ef0f, I'm getting a build failure

org.trellisldp.osgi.OSGiTest > classMethod FAILED
    java.lang.RuntimeException

with stacktrace as shown below. I have no idea what's going on here. I don't see any Trellis code even mentioned at all. Perhaps another Java8 weirdity?

java.lang.RuntimeException: Container never came up
    at org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.stop(KarafTestContainer.java:628)
    at org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.tearDown(EagerSingleStagedReactor.java:118)
    at org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.afterClass(EagerSingleStagedReactor.java:132)
    at org.ops4j.pax.exam.spi.reactors.ReactorManager.afterClass(ReactorManager.java:441)
    at org.ops4j.pax.exam.junit.impl.ProbeRunner.run(ProbeRunner.java:107)
    at org.ops4j.pax.exam.junit.PaxExam.run(PaxExam.java:93)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:39)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.Iterator.forEachRemaining(Iterator.java:116)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
    at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:79)
    at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:70)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
    at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
    at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:92)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$100(JUnitPlatformTestClassProcessor.java:77)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:73)
    at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
    at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
    at com.sun.proxy.$Proxy2.stop(Unknown Source)
    at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:131)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:155)
    at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:137)
    at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.lang.Thread.run(Thread.java:745)
acoburn commented 5 years ago

I have not been able to reproduce this on my java 8 environment. What I wonder is whether these pax-exam tests should be made part of a separate build profile (e.g. ./gradlew check -p integrationTests) and not part of the main build process.

ajs6f commented 5 years ago

Hm. The distinction I'm seeing is "tests that test all distribution" (i.e. no matter your platform or how you are wiring up or whatever, you should be able to pass this test) vs. "tests for a given distribution" (i.e. OSGi should be able to do this OSGi thing).

To the extent that people who have no interest in a given platform or wiring framework can ignore them (e.g. a build profile), yay! Of course, making things more independent means more "late-binding failure". I.e. someone is more likely to be able to make a commit over here that blows up platform X over there, but they don't see it because they forgot to run the tests for X. Given the size of the community and the small codebase right now, I think we can rely on CI and courtesy to avoid any such problems, at least for some time to come.

ajs6f commented 5 years ago

Incidentally, I'm at:

Java version: 1.8.0_65, vendor: Oracle Corporation

Which Java 8 are you using locally?

acoburn commented 5 years ago
Java version: 1.8.0_172, vendor: Oracle Corporation

You can also skip a particular stage with this command:

./gradlew clean check -x :trellis-osgi:test

I think that making the OSGi builds "opt-in" rather than "opt-out" (as they are now) would make sense -- the CI configuration would naturally run all the build profiles.

ajs6f commented 5 years ago

👍

Do you think it's safe for me to just skip the tests entirely for now, or should I just work off of the JARs you're pushing to Maven? I feel a bit better about the latter, for obvious reasons.

acoburn commented 5 years ago

I've been keeping the SNAPSHOT jars on maven up-to-date, so I'd suggest using those, if possible. If you're trying to test a PR, that's a different matter, but in the general case, using a maven jar makes the most sense to me.

ajs6f commented 5 years ago

No, I'm happy to do that! Thanks for keeping the repository stuff up-to-date; I know that's work, but it's really helpful.

acoburn commented 5 years ago

In principle, we could make that part of the CI process (every build of master publishes artifacts on the SNAPSHOT repos), but I am hesitant to give out my credentials to Travis-CI. AFAIK, sonatype needs a username/password, rather than a revokable OAuth token, and I'm not interested in sharing that.

ajs6f commented 5 years ago

Understandably. It's surprising that Sonatype has that limitation. We could make a Trellis account (if Sonatype allows that) but then we're just shifting the secret around. On the list of "when there's time" stuff, we could put up an instance of something like Apache Archiva for this kind of thing.

For now, I hope you're okay just pushing a repo now and then?

acoburn commented 5 years ago

I found a way to make use of a revokable token with Sonatype, so I'll figure out how to integrate that into the Travis build.

ajs6f commented 5 years ago

Superb!