Skip to content

Build failure: PersistentAcceptOnceFileListFilterExternalStoreTests. executionError #2782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chris-jansson opened this issue Mar 4, 2019 · 18 comments
Assignees
Labels
status: waiting-for-reporter Needs a feedback from the reporter status: waiting-for-triage The issue need to be evaluated and its future decided

Comments

@chris-jansson
Copy link

Linking this from my Stack Overflow post, at @artembilan's request.

Per his comment, I tried cleaning the project before building, but that didn't change the result.

Environment

macOS 10.13.6

Steps to Reproduce

git clone git://github.com/spring-projects/spring-integration.git
cd spring-integration
./gradlew build

Result

Starting a Gradle Daemon (subsequent builds will be faster)

> Task :spring-integration-core:test
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
Exception in thread "executor-1" org.springframework.messaging.core.DestinationResolutionException: A bean definition with name 'errorChannel' exists, but failed to be created; nested exception is org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'errorChannel': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
        at org.springframework.integration.support.channel.BeanFactoryChannelResolver.resolveDestination(BeanFactoryChannelResolver.java:93)
        at org.springframework.integration.support.channel.BeanFactoryChannelResolver.resolveDestination(BeanFactoryChannelResolver.java:46)
        at org.springframework.integration.core.ErrorMessagePublisher.populateChannel(ErrorMessagePublisher.java:214)
        at org.springframework.integration.core.ErrorMessagePublisher.getChannel(ErrorMessagePublisher.java:83)
        at org.springframework.integration.channel.MessagePublishingErrorHandler.getDefaultErrorChannel(MessagePublishingErrorHandler.java:77)
        at org.springframework.integration.channel.MessagePublishingErrorHandler.resolveErrorChannel(MessagePublishingErrorHandler.java:128)
        at org.springframework.integration.channel.MessagePublishingErrorHandler.handleError(MessagePublishingErrorHandler.java:91)
        at org.springframework.integration.util.ErrorHandlingTaskExecutor.lambda$execute$0(ErrorHandlingTaskExecutor.java:60)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'errorChannel': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:208)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)
        at org.springframework.integration.support.channel.BeanFactoryChannelResolver.resolveDestination(BeanFactoryChannelResolver.java:89)
        ... 10 more

> Task :spring-integration-file:test

org.springframework.integration.file.filters.PersistentAcceptOnceFileListFilterExternalStoreTests > executionError FAILED
    java.lang.AssertionError

293 tests completed, 1 failed, 1 skipped

> Task :spring-integration-file:test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':spring-integration-file:test'.
> There were failing tests. See the report at: file:///Users/e063468/IdeaProjects/spring-integration/spring-integration-file/build/reports/tests/test/index.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.2.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 13m 31s
346 actionable tasks: 138 executed, 208 up-to-date

I would expect to be able to clone and build with no issues, seeing as I haven't changed any files. Any idea what's wrong?

@artembilan
Copy link
Member

Can share, please, the report mention in those logs as well: file:///Users/e063468/IdeaProjects/spring-integration/spring-integration-file/build/reports/tests/test/index.html ?

The error you show is not related to that test case at all...

Looks like there is some not closed ApplicationContext in other test classes in this file module.
At least I see one AutoCreateDirectoryIntegrationTests which comes without @DirtiesContext and the started channel adapter for the FileReadingMessageSource is not stopped in the test, so it continues to use a TaskScheduler and therefore may fail with the mention error eventually.

Anyway, please, report!

@artembilan artembilan self-assigned this Mar 4, 2019
@artembilan artembilan added status: waiting-for-reporter Needs a feedback from the reporter status: waiting-for-triage The issue need to be evaluated and its future decided labels Mar 4, 2019
artembilan added a commit that referenced this issue Mar 4, 2019
@artembilan
Copy link
Member

I've just pushed a couple fixes to the file module tests: 20fde27

Please, consider to pull the latest master to your local copy and re-run tests again.

Thanks

@chris-jansson
Copy link
Author

Sure thing. I pulled down the latest updates, and that cleaned up some of the output--the DestinationResolutionException stack trace is gone now. Remaining output of ./gradlew build:

> Task :spring-integration-core:test
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message transform method call failed at JPLISAgent.c line: 844

> Task :spring-integration-file:test

org.springframework.integration.file.filters.PersistentAcceptOnceFileListFilterExternalStoreTests > executionError FAILED
    java.lang.AssertionError

293 tests completed, 1 failed, 1 skipped

> Task :spring-integration-file:test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':spring-integration-file:test'.
> There were failing tests. See the report at: file:///Users/e063468/tmp/spring-integration/spring-integration-file/build/reports/tests/test/index.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.2.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 12m 57s
346 actionable tasks: 346 executed

Here's a screenshot from that report:

image

When I click on the error:

image

and the stack trace beneath it:

java.lang.AssertionError
	at org.gradle.api.internal.tasks.testing.processors.TestOutputRedirector.setOutputOwner(TestOutputRedirector.java:49)
	at org.gradle.api.internal.tasks.testing.processors.CaptureTestOutputTestResultProcessor.completed(CaptureTestOutputTestResultProcessor.java:80)
	at org.gradle.api.internal.tasks.testing.results.AttachParentTestResultProcessor.completed(AttachParentTestResultProcessor.java:56)
	at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.actor.internal.DefaultActorFactory$BlockingActor.dispatch(DefaultActorFactory.java:122)
	at org.gradle.internal.actor.internal.DefaultActorFactory$BlockingActor.dispatch(DefaultActorFactory.java:97)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy3.completed(Unknown Source)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestExecutionListener.reportSkipped(JUnitPlatformTestExecutionListener.java:126)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestExecutionListener.executionSkipped(JUnitPlatformTestExecutionListener.java:81)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestExecutionListener.lambda$reportSkipped$1(JUnitPlatformTestExecutionListener.java:124)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at java.util.Collections$SynchronizedCollection.forEach(Collections.java:2062)
	at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestExecutionListener.reportSkipped(JUnitPlatformTestExecutionListener.java:124)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestExecutionListener.executionFinished(JUnitPlatformTestExecutionListener.java:94)
	at org.junit.platform.launcher.core.TestExecutionListenerRegistry$CompositeTestExecutionListener.lambda$executionFinished$5(TestExecutionListenerRegistry.java:92)
	at java.util.ArrayList.forEach(ArrayList.java:1257)
	at org.junit.platform.launcher.core.TestExecutionListenerRegistry.notifyTestExecutionListeners(TestExecutionListenerRegistry.java:59)
	at org.junit.platform.launcher.core.TestExecutionListenerRegistry.access$100(TestExecutionListenerRegistry.java:28)
	at org.junit.platform.launcher.core.TestExecutionListenerRegistry$CompositeTestExecutionListener.executionFinished(TestExecutionListenerRegistry.java:92)
	at org.junit.platform.launcher.core.ExecutionListenerAdapter.executionFinished(ExecutionListenerAdapter.java:56)
	at org.junit.vintage.engine.execution.RunListenerAdapter.fireExecutionFinished(RunListenerAdapter.java:202)
	at org.junit.vintage.engine.execution.RunListenerAdapter.testRunFinished(RunListenerAdapter.java:87)
	at org.junit.runner.notification.SynchronizedRunListener.testRunFinished(SynchronizedRunListener.java:42)
	at org.junit.runner.notification.RunNotifier$2.notifyListener(RunNotifier.java:103)
	at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
	at org.junit.runner.notification.RunNotifier.fireTestRunFinished(RunNotifier.java:100)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
	at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:40)
	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:80)
	at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:71)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:229)
	at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:197)
	at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:211)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:191)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:102)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:82)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:78)
	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:498)
	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:132)
	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:498)
	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:175)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
	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:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
	at java.lang.Thread.run(Thread.java:748)

@artembilan
Copy link
Member

Can you also show what is on the Standard output page?

I wonder too if you have Redis running locally...

@chris-jansson
Copy link
Author

I don't have Redis running, should I?

Here's the Standard output:

2019-03-05 08:51:17,728 WARN [Test worker] [org.apache.geode.distributed.internal.InternalDistributedSystem] - org/springframework/shell/core/Parser
java.lang.NoClassDefFoundError: org/springframework/shell/core/Parser
	at org.apache.geode.management.internal.beans.MemberMBeanBridge.<init>(MemberMBeanBridge.java:334) ~[geode-core-1.8.0.jar:?]
	at org.apache.geode.management.internal.beans.ManagementAdapter.handleCacheCreation(ManagementAdapter.java:144) ~[geode-core-1.8.0.jar:?]
	at org.apache.geode.management.internal.beans.ManagementListener.handleEvent(ManagementListener.java:115) ~[geode-core-1.8.0.jar:?]
	at org.apache.geode.distributed.internal.InternalDistributedSystem.notifyResourceEventListeners(InternalDistributedSystem.java:2185) ~[geode-core-1.8.0.jar:?]
	at org.apache.geode.distributed.internal.InternalDistributedSystem.handleResourceEvent(InternalDistributedSystem.java:596) ~[geode-core-1.8.0.jar:?]
	at org.apache.geode.internal.cache.GemFireCacheImpl.initialize(GemFireCacheImpl.java:1211) ~[geode-core-1.8.0.jar:?]
	at org.apache.geode.internal.cache.GemFireCacheImpl.basicCreate(GemFireCacheImpl.java:797) ~[geode-core-1.8.0.jar:?]
	at org.apache.geode.internal.cache.GemFireCacheImpl.create(GemFireCacheImpl.java:783) ~[geode-core-1.8.0.jar:?]
	at org.apache.geode.cache.CacheFactory.create(CacheFactory.java:176) ~[geode-core-1.8.0.jar:?]
	at org.apache.geode.cache.CacheFactory.create(CacheFactory.java:223) ~[geode-core-1.8.0.jar:?]
	at org.springframework.integration.file.filters.PersistentAcceptOnceFileListFilterExternalStoreTests.testFileSystemWithGemfireMetadataStore(PersistentAcceptOnceFileListFilterExternalStoreTests.java:77) ~[test/:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) ~[junit-4.12.jar:4.12]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) ~[junit-4.12.jar:4.12]
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) ~[junit-4.12.jar:4.12]
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) ~[junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) ~[junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) ~[junit-4.12.jar:4.12]
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) ~[junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) ~[junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) ~[junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) ~[junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) ~[junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) ~[junit-4.12.jar:4.12]
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) ~[junit-4.12.jar:4.12]
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) ~[junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) ~[junit-4.12.jar:4.12]
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137) ~[junit-4.12.jar:4.12]
	at org.junit.runner.JUnitCore.run(JUnitCore.java:115) ~[junit-4.12.jar:4.12]
	at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:40) ~[junit-vintage-engine-5.4.0.jar:5.4.0]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:1.8.0_181]
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_181]
	at java.util.Iterator.forEachRemaining(Iterator.java:116) ~[?:1.8.0_181]
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) ~[?:1.8.0_181]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_181]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_181]
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:1.8.0_181]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:1.8.0_181]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_181]
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:1.8.0_181]
	at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80) ~[junit-vintage-engine-5.4.0.jar:5.4.0]
	at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:71) ~[junit-vintage-engine-5.4.0.jar:5.4.0]
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:229) ~[junit-platform-launcher-1.4.0.jar:1.4.0]
	at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:197) ~[junit-platform-launcher-1.4.0.jar:1.4.0]
	at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:211) [junit-platform-launcher-1.4.0.jar:1.4.0]
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:191) [junit-platform-launcher-1.4.0.jar:1.4.0]
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128) [junit-platform-launcher-1.4.0.jar:1.4.0]
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:102) [gradle-testing-junit-platform-5.2.1.jar:5.2.1]
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:82) [gradle-testing-junit-platform-5.2.1.jar:5.2.1]
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:78) [gradle-testing-junit-platform-5.2.1.jar:5.2.1]
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61) [gradle-testing-base-5.2.1.jar:5.2.1]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) [gradle-messaging-5.2.1.jar:5.2.1]
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) [gradle-messaging-5.2.1.jar:5.2.1]
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32) [gradle-messaging-5.2.1.jar:5.2.1]
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) [gradle-messaging-5.2.1.jar:5.2.1]
	at com.sun.proxy.$Proxy2.stop(Unknown Source) [?:?]
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:132) [gradle-testing-base-5.2.1.jar:5.2.1]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) [gradle-messaging-5.2.1.jar:5.2.1]
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) [gradle-messaging-5.2.1.jar:5.2.1]
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175) [gradle-messaging-5.2.1.jar:5.2.1]
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157) [gradle-messaging-5.2.1.jar:5.2.1]
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404) [gradle-messaging-5.2.1.jar:5.2.1]
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) [gradle-base-services-5.2.1.jar:5.2.1]
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) [gradle-base-services-5.2.1.jar:5.2.1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_181]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_181]
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) [gradle-base-services-5.2.1.jar:5.2.1]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
Caused by: java.lang.ClassNotFoundException: org.springframework.shell.core.Parser
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_181]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_181]
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[?:1.8.0_181]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_181]
	... 79 more

@artembilan
Copy link
Member

Well, how does it work if you have Redis locally on the default port?
I just try to figure out what is the real problem and why it works for me even without Redis...

@artembilan
Copy link
Member

Can you run, please, this PersistentAcceptOnceFileListFilterExternalStoreTests from your IDE? What is the result from there?

@artembilan
Copy link
Member

Wait. What Java version do you use?
The fact is that project is not so ready to be built with Java 11.

@chris-jansson
Copy link
Author

Build successful with Redis running! My java version, since you asked:

java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

Might be helpful to include the Redis requirement in the top level README. Thanks for your help

@garyrussell
Copy link
Contributor

The @RedisAvailable annotation should prevent that test from running when Redis is not running on localhost.

Might be an issue with the JUnit4 emulator in JUnit5. According to your screen shot, it is in something called reportSkipped so it's definitely weird.

@artembilan
Copy link
Member

Yes, it fails for me with the same issue when I don't have Redis and run tests from Gradle.

Looks like something is wrong with JUnit Jupiter runner for Gradle...

@artembilan artembilan reopened this Mar 5, 2019
@garyrussell
Copy link
Contributor

garyrussell commented Mar 5, 2019

Interesting; the rule is running ok - I added some dbugging...

org.springframework.integration.file.filters.PersistentAcceptOnceFileListFilterExternalStoreTests STANDARD_OUT
    Connecting
    Redis Down, skipping test

@artembilan
Copy link
Member

Right, looks like the problem is with exactly JUnit Platform:

at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestExecutionListener.reportSkipped(JUnitPlatformTestExecutionListener.java:126)
at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestExecutionListener.executionSkipped(JUnitPlatformTestExecutionListener.java:81)
at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestExecutionListener.lambda$reportSkipped$1(JUnitPlatformTestExecutionListener.java:124)

There is similar issue already reported on Gradle: gradle/gradle#8181. But not exactly ours though...

/CC @sbrannen

@artembilan
Copy link
Member

Well, I have just tested with Gradle 4.10.2 and it works well.
I have an ignored method and everything else passed:
default

The classMethod is weird name though and doesn't bring us any clues about the real method, but that's already a different story...
Although might be exactly a unique description issue mentioned in the Gradle issue above.

So, now i wonder who and how generates for us that classMethod instead of really ignored testFileSystemWithRedisMetadataStore...

@artembilan
Copy link
Member

The Gradle issue on the matter: gradle/gradle#8685.

Thank you, @chris-jansson , for catching this one!

@marcphilipp
Copy link
Contributor

While this should not cause Gradle to fail in this way (let's continue that discussion in gradle/gradle#8685), the rule implementation should be changed to:

public final class RedisAvailableRule implements MethodRule {
    // ...
	public Statement apply(final Statement base, final FrameworkMethod method, Object target) {
		return new Statement() {
            @Override
            public void evaluate() throws Throwable {
                RedisAvailable redisAvailable = method.getAnnotation(RedisAvailable.class);
                if (redisAvailable != null) {
                    if (connectionFactory != null) {
                        try {
                            connectionFactory.getConnection();
                            base.evaluate();
                        }
                        catch (Exception e) {
                            Assume.assumeTrue("Skipping test due to Redis not being available on port: " + REDIS_PORT + ": " + e, false);
                        }
                    }
                }
            }
        };
	}
}

This way instead of classError the actual test will be reported as skipped.

marcphilipp added a commit to marcphilipp/spring-integration that referenced this issue Mar 8, 2019
Prior to this commit, `RedisAvailableRule.apply()` threw an
`AssumptionViolatedException` when Redis was unavailable. That caused
the execution of the current test class and all pending test methods to
be stopped immediately. Instead, it now returns a `Statement` that
throws the exception in case Redis us unavailable which will only skip
the current test.

Resolves spring-projects#2782.
@marcphilipp
Copy link
Contributor

I've submitted #2796 to fix this issue.

marcphilipp added a commit to marcphilipp/spring-integration that referenced this issue Mar 8, 2019
Prior to this commit, `RedisAvailableRule.apply()` threw an
`AssumptionViolatedException` when Redis was unavailable. That caused
the execution of the current test class and all pending test methods to
be stopped immediately. Instead, it now returns a `Statement` that
throws the exception in case Redis us unavailable which will only skip
the current test.

Resolves spring-projects#2782.
@sbrannen
Copy link
Member

sbrannen commented Mar 8, 2019

While this should not cause Gradle to fail in this way (let's continue that discussion in gradle/gradle#8685), the rule implementation should be changed to:

Good catch, @marcphilipp! 👍

marcphilipp added a commit to marcphilipp/spring-integration that referenced this issue Mar 8, 2019
Prior to this commit, `RedisAvailableRule.apply()` threw an
`AssumptionViolatedException` when Redis was unavailable. That caused
the execution of the current test class and all pending test methods to
be stopped immediately. Instead, it now returns a `Statement` that
throws the exception in case Redis us unavailable which will only skip
the current test.

Resolves spring-projects#2782.
marcphilipp added a commit to marcphilipp/spring-integration that referenced this issue Mar 8, 2019
Prior to this commit, `RedisAvailableRule.apply()` threw an
`AssumptionViolatedException` when Redis was unavailable. That caused
the execution of the current test class and all pending test methods to
be stopped immediately. Instead, it now returns a `Statement` that
throws the exception in case Redis is unavailable which will only skip
the current test.

Resolves spring-projects#2782.
marcphilipp added a commit to marcphilipp/spring-integration that referenced this issue Mar 8, 2019
Prior to this commit, `RedisAvailableRule.apply()` threw an
`AssumptionViolatedException` when Redis was unavailable. That caused
the execution of the current test class and all pending test methods to
be stopped immediately. Instead, it now returns a `Statement` that
throws the exception in case Redis is unavailable which will only skip
the current test.

Resolves spring-projects#2782.
garyrussell pushed a commit that referenced this issue Mar 8, 2019
Prior to this commit, `RedisAvailableRule.apply()` threw an
`AssumptionViolatedException` when Redis was unavailable. That caused
the execution of the current test class and all pending test methods to
be stopped immediately. Instead, it now returns a `Statement` that
throws the exception in case Redis is unavailable which will only skip
the current test.

Resolves #2782.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-reporter Needs a feedback from the reporter status: waiting-for-triage The issue need to be evaluated and its future decided
Projects
None yet
Development

No branches or pull requests

5 participants