spring-projects / spring-integration

Spring Integration provides an extension of the Spring programming model to support the well-known Enterprise Integration Patterns (EIP)
http://projects.spring.io/spring-integration/
Apache License 2.0
1.54k stars 1.11k forks source link

Build failure: PersistentAcceptOnceFileListFilterExternalStoreTests. executionError #2782

Closed chris-jansson closed 5 years ago

chris-jansson commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

I've just pushed a couple fixes to the file module tests: https://github.com/spring-projects/spring-integration/commit/20fde27e6585b2c8a85a0815904c1746c1f3fd1d

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

Thanks

chris-jansson commented 5 years ago

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 commented 5 years ago

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

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

chris-jansson commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

artembilan commented 5 years ago

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

chris-jansson commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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...

garyrussell commented 5 years ago

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

org.springframework.integration.file.filters.PersistentAcceptOnceFileListFilterExternalStoreTests STANDARD_OUT
    Connecting
    Redis Down, skipping test
artembilan commented 5 years ago

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: https://github.com/gradle/gradle/issues/8181. But not exactly ours though...

/CC @sbrannen

artembilan commented 5 years ago

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 commented 5 years ago

The Gradle issue on the matter: https://github.com/gradle/gradle/issues/8685.

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

marcphilipp commented 5 years ago

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 commented 5 years ago

I've submitted #2796 to fix this issue.

sbrannen commented 5 years ago

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! 👍