Repository: ignite
Updated Branches:
  refs/heads/ignite-5789-1 3daf81286 -> fbf252ba7


IGNITE-8381 Fix for flaky failures of testNodeSingletonDeploy in Basic 2 - 
Fixes #3996.

Signed-off-by: dpavlov <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8f2eeee5
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8f2eeee5
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8f2eeee5

Branch: refs/heads/ignite-5789-1
Commit: 8f2eeee57b13a4e5b2dcc7d1b407f66a97d71169
Parents: fdad641
Author: Vyacheslav Daradur <[email protected]>
Authored: Fri May 18 16:20:51 2018 +0300
Committer: dpavlov <[email protected]>
Committed: Fri May 18 16:20:51 2018 +0300

----------------------------------------------------------------------
 ...gniteServiceConfigVariationsFullApiTest.java | 22 ++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8f2eeee5/modules/core/src/test/java/org/apache/ignite/internal/processors/service/IgniteServiceConfigVariationsFullApiTest.java
----------------------------------------------------------------------
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 453ddc0..825e561 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.internal.IgniteEx;
 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 class IgniteServiceConfigVariationsFullApiTest 
extends IgniteConfigVariat
      */
     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 class IgniteServiceConfigVariationsFullApiTest 
extends IgniteConfigVariat
      */
     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 class IgniteServiceConfigVariationsFullApiTest 
extends IgniteConfigVariat
                 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 @@ public class IgniteServiceConfigVariationsFullApiTest 
extends IgniteConfigVariat
          * @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;
     }
 
     /**

Reply via email to