Project: springxd
Issue XD-1269: Investigate and remove explicit thread sleep in AbstractSingleNodeStreamDeploymentIntegrationTests
There are explicit Thread.sleep() calls after deploy() in some of the test methods in AbstractSingleNodeStreamDeploymentIntegrationTests. Also, the test method deployAndUndeploy() doesn't have explicit Thread.sleep() and fails inconsistently with this error: java.lang.AssertionError: stream test0 not undeployed org.junit.Assert.fail(Assert.java:88) org.junit.Assert.assertTrue(Assert.java:41) org.springframework.xd.dirt.stream.AbstractSingleNodeStreamDeploymentIntegrationTests.waitForUndeploy(AbstractSingleNodeStreamDeploymentIntegrationTests.java:332) org.springframework.xd.dirt.stream.AbstractSingleNodeStreamDeploymentIntegrationTests.deployAndUndeploy(AbstractSingleNodeStreamDeploymentIntegrationTests.java:221) 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:601) org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) 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.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) org.springframework.xd.test.AbstractExternalResourceTestSupport$1.evaluate(AbstractExternalResourceTestSupport.java:71) org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48) org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48) org.junit.rules.RunRules.evaluate(RunRules.java:20) 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:601) 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:601) 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:722)
Story points: 3