From 8000c7ebcea14075edc5e7c130c8fd70a1d8d01c Mon Sep 17 00:00:00 2001 From: Vyacheslav Daradur Date: Wed, 16 May 2018 13:01:43 +0300 Subject: [PATCH 1/3] ignite-8381: waiting of deployment was added as workaround solution --- ...iteServiceConfigVariationsFullApiTest.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceConfigVariationsFullApiTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceConfigVariationsFullApiTest.java index 453ddc0fb1872..825e56111e586 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceConfigVariationsFullApiTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceConfigVariationsFullApiTest.java @@ -36,6 +36,7 @@ import org.apache.ignite.services.Service; import org.apache.ignite.services.ServiceConfiguration; import org.apache.ignite.services.ServiceContext; +import org.apache.ignite.testframework.GridTestUtils; import org.apache.ignite.testframework.configvariations.Parameters; import org.apache.ignite.testframework.junits.IgniteConfigVariationsAbstractTest; @@ -46,6 +47,9 @@ public class IgniteServiceConfigVariationsFullApiTest extends IgniteConfigVariat /** Test service name. */ private static final String SERVICE_NAME = "testService"; + /** Timeout to wait finish of a service's deployment. */ + private static final long DEPLOYMENT_WAIT_TIMEOUT = 10_000L; + /** Test service name. */ private static final String CACHE_NAME = "testCache"; @@ -82,8 +86,11 @@ public class IgniteServiceConfigVariationsFullApiTest extends IgniteConfigVariat */ public void testNodeSingletonDeploy() throws Exception { runInAllDataModes(new ServiceTestRunnable(true, new DeployClosure() { - @Override public void run(IgniteServices services, String svcName, TestService svc) { + @Override public void run(IgniteServices services, String svcName, TestService svc) throws Exception { services.deployNodeSingleton(svcName, (Service)svc); + + // TODO: Waiting for deployment should be removed after IEP-17 completion + GridTestUtils.waitForCondition(() -> services.service(svcName) != null, DEPLOYMENT_WAIT_TIMEOUT); } })); } @@ -95,8 +102,11 @@ public void testNodeSingletonDeploy() throws Exception { */ public void testClusterSingletonDeploy() throws Exception { runInAllDataModes(new ServiceTestRunnable(false, new DeployClosure() { - @Override public void run(IgniteServices services, String svcName, TestService svc) { + @Override public void run(IgniteServices services, String svcName, TestService svc) throws Exception { services.deployClusterSingleton(svcName, (Service)svc); + + // TODO: Waiting for deployment should be removed after IEP-17 completion + GridTestUtils.waitForCondition(() -> services.service(svcName) != null, DEPLOYMENT_WAIT_TIMEOUT); } })); } @@ -141,7 +151,7 @@ public void testMultipleDeploy() throws Exception { */ public void testDeploy() throws Exception { runInAllDataModes(new ServiceTestRunnable(false, new DeployClosure() { - @Override public void run(IgniteServices services, String svcName, TestService svc) { + @Override public void run(IgniteServices services, String svcName, TestService svc) throws Exception { services.deployClusterSingleton(svcName, (Service)svc); ServiceConfiguration cfg = new ServiceConfiguration(); @@ -157,6 +167,9 @@ public void testDeploy() throws Exception { cfg.setNodeFilter(services.clusterGroup().predicate()); services.deploy(cfg); + + // TODO: Waiting for deployment should be removed after IEP-17 completion + GridTestUtils.waitForCondition(() -> services.service(svcName) != null, DEPLOYMENT_WAIT_TIMEOUT); } })); } @@ -198,8 +211,9 @@ interface DeployClosure { * @param services Services. * @param svcName Service name. * @param svc Service. + * @throws Exception In case of an error. */ - void run(IgniteServices services, String svcName, TestService svc); + void run(IgniteServices services, String svcName, TestService svc) throws Exception; } /** From 6e8c9b30a40bca620606a54123487e369ed248a2 Mon Sep 17 00:00:00 2001 From: Vyacheslav Daradur Date: Wed, 16 May 2018 13:04:00 +0300 Subject: [PATCH 2/3] fake TestSuite added --- .../ignite/testsuites/IgniteCacheFailoverTestSuite3.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java index f1cf2676b7531..16e7b1c0d29f3 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java @@ -31,12 +31,6 @@ public class IgniteCacheFailoverTestSuite3 extends TestSuite { * @throws Exception Thrown in case of the failure. */ public static TestSuite suite() throws Exception { - TestSuite suite = new TestSuite("Cache Failover Test Suite3"); - - suite.addTestSuite(IgniteCachePutRetryAtomicSelfTest.class); - suite.addTestSuite(IgniteCachePutRetryTransactionalSelfTest.class); - suite.addTestSuite(CacheGetInsideLockChangingTopologyTest.class); - - return suite; + return IgniteServiceConfigVariationsFullApiTestSuite.suite(); } } From 230d7e204323dcf207f992ccd162814b1d5b4b67 Mon Sep 17 00:00:00 2001 From: Vyacheslav Daradur Date: Thu, 17 May 2018 07:52:41 +0300 Subject: [PATCH 3/3] Revert "fake TestSuite added" This reverts commit 6e8c9b30a40bca620606a54123487e369ed248a2. --- .../ignite/testsuites/IgniteCacheFailoverTestSuite3.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java index 16e7b1c0d29f3..f1cf2676b7531 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite3.java @@ -31,6 +31,12 @@ public class IgniteCacheFailoverTestSuite3 extends TestSuite { * @throws Exception Thrown in case of the failure. */ public static TestSuite suite() throws Exception { - return IgniteServiceConfigVariationsFullApiTestSuite.suite(); + TestSuite suite = new TestSuite("Cache Failover Test Suite3"); + + suite.addTestSuite(IgniteCachePutRetryAtomicSelfTest.class); + suite.addTestSuite(IgniteCachePutRetryTransactionalSelfTest.class); + suite.addTestSuite(CacheGetInsideLockChangingTopologyTest.class); + + return suite; } }