Minor corrections in tests.

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

Branch: refs/heads/ignite-2893
Commit: 5dab5fb65d97921d7e28e04283a3d47d00c44a25
Parents: fb1dea7
Author: Alexey Goncharuk <alexey.goncha...@gmail.com>
Authored: Wed Apr 19 14:22:00 2017 +0300
Committer: Alexey Goncharuk <alexey.goncha...@gmail.com>
Committed: Wed Apr 19 14:22:00 2017 +0300

----------------------------------------------------------------------
 ...ServiceProcessorMultiNodeConfigSelfTest.java | 23 ++++++++-------
 .../GridServiceProcessorMultiNodeSelfTest.java  | 31 ++++++++++----------
 2 files changed, 27 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5dab5fb6/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java
index 16e5e30..bd47b53 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeConfigSelfTest.java
@@ -55,7 +55,6 @@ public class GridServiceProcessorMultiNodeConfigSelfTest 
extends GridServiceProc
 
     /** {@inheritDoc} */
     @Override protected ServiceConfiguration[] services() {
-        List<ServiceConfiguration> cfgs = new ArrayList<>();
 
         ServiceConfiguration cfg = new ServiceConfiguration();
 
@@ -64,6 +63,8 @@ public class GridServiceProcessorMultiNodeConfigSelfTest 
extends GridServiceProc
         cfg.setTotalCount(1);
         cfg.setService(new DummyService());
 
+        List<ServiceConfiguration> cfgs = new ArrayList<>();
+
         cfgs.add(cfg);
 
         cfg = new ServiceConfiguration();
@@ -201,12 +202,12 @@ public class GridServiceProcessorMultiNodeConfigSelfTest 
extends GridServiceProc
 
         checkCount(name, g.services().serviceDescriptors(), nodeCount());
 
-        int extraNodes = 2;
-
         CountDownLatch latch = new CountDownLatch(1);
 
         DummyService.exeLatch(name, latch);
 
+        int extraNodes = 2;
+
         startExtraNodes(extraNodes);
 
         try {
@@ -270,10 +271,10 @@ public class GridServiceProcessorMultiNodeConfigSelfTest 
extends GridServiceProc
 
             waitForDeployment(name, nodeCount() + newNodes);
 
+            // Since we start extra nodes, there may be extra start and cancel 
events,
+            // so we check only the difference between start and cancel and
+            // not start and cancel events individually.
             assertEquals(name, newNodes,  DummyService.started(name) - 
DummyService.cancelled(name));
-// Next may fails. Server can be restarted on unstable topology.
-//            assertEquals(name, newNodes, DummyService.started(name));
-//            assertEquals(name, 0, DummyService.cancelled(name));
 
             checkCount(name, g.services().serviceDescriptors(), nodeCount() + 
newNodes);
         }
@@ -294,12 +295,13 @@ public class GridServiceProcessorMultiNodeConfigSelfTest 
extends GridServiceProc
         Ignite g = randomGrid();
 
         int servers = 2;
-        int clients = 2;
 
         CountDownLatch latch = new CountDownLatch(servers);
 
         DummyService.exeLatch(name, latch);
 
+        int clients = 2;
+
         startExtraNodes(servers, clients);
 
         try {
@@ -307,11 +309,10 @@ public class GridServiceProcessorMultiNodeConfigSelfTest 
extends GridServiceProc
 
             waitForDeployment(name, nodeCount() + servers);
 
+            // Since we start extra nodes, there may be extra start and cancel 
events,
+            // so we check only the difference between start and cancel and
+            // not start and cancel events individually.
             assertEquals(name, servers,  DummyService.started(name) - 
DummyService.cancelled(name));
-// Next may fails. Server can be restarted on unstable topology.
-//            assertEquals(name, servers, DummyService.started(name));
-//            assertEquals(name, 0, DummyService.cancelled(name));
-
 
             checkCount(name, g.services().serviceDescriptors(), nodeCount() + 
servers);
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/5dab5fb6/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeSelfTest.java
index 32d1462..df7ddf1 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceProcessorMultiNodeSelfTest.java
@@ -152,12 +152,13 @@ public class GridServiceProcessorMultiNodeSelfTest 
extends GridServiceProcessorA
             assertEquals(name, 0, DummyService.cancelled(name));
 
             int servers = 2;
-            int clients = 2;
 
             latch = new CountDownLatch(servers);
 
             DummyService.exeLatch(name, latch);
 
+            int clients = 2;
+
             startExtraNodes(servers, clients);
 
             try {
@@ -165,12 +166,11 @@ public class GridServiceProcessorMultiNodeSelfTest 
extends GridServiceProcessorA
 
                 waitForDeployment(name, servers);
 
+                // Since we start extra nodes, there may be extra start and 
cancel events,
+                // so we check only the difference between start and cancel and
+                // not start and cancel events individually.
                 assertEquals(name, nodeCount() + servers,  
DummyService.started(name) - DummyService.cancelled(name));
 
-//                 Next may fails. Server can be restarted on unstable 
topology.
-//                assertEquals(name, nodeCount() + servers, 
DummyService.started(name));
-//                assertEquals(name, 0, DummyService.cancelled(name));
-
                 checkCount(name, g.services().serviceDescriptors(), 
nodeCount() + servers);
             }
             finally {
@@ -241,13 +241,12 @@ public class GridServiceProcessorMultiNodeSelfTest 
extends GridServiceProcessorA
 
                 waitForDeployment(name, prestartedNodes + extraNodes);
 
+                // Since we start extra nodes, there may be extra start and 
cancel events,
+                // so we check only the difference between start and cancel and
+                // not start and cancel events individually.
                 assertEquals(name, prestartedNodes + extraNodes,
                     DummyService.started(name) - DummyService.cancelled(name));
 
-//                 Next may fails. Server can be restarted on unstable 
topology.
-//                assertEquals(name, prestartedNodes + extraNodes, 
DummyService.started(name));
-//                assertEquals(name, 0, DummyService.cancelled(name));
-
                 checkCount(name, g.services().serviceDescriptors(), 
prestartedNodes + extraNodes);
             }
             finally {
@@ -262,6 +261,7 @@ public class GridServiceProcessorMultiNodeSelfTest extends 
GridServiceProcessorA
     /**
      * @throws Exception If failed.
      */
+    @SuppressWarnings("deprecation")
     public void testDeployLimits() throws Exception {
         final String name = "serviceWithLimitsUpdateTopology";
 
@@ -299,25 +299,24 @@ public class GridServiceProcessorMultiNodeSelfTest 
extends GridServiceProcessorA
 
         checkCount(name, g.services().serviceDescriptors(), nodeCount());
 
-        int extraNodes = 2;
-
         latch = new CountDownLatch(1);
 
         DummyService.exeLatch(name, latch);
 
-        startExtraNodes(2);
+        int extraNodes = 2;
+
+        startExtraNodes(extraNodes);
 
         try {
             latch.await();
 
             waitForDeployment(name, totalInstances);
 
+            // Since we start extra nodes, there may be extra start and cancel 
events,
+            // so we check only the difference between start and cancel and
+            // not start and cancel events individually.
             assertEquals(name, totalInstances,  DummyService.started(name) - 
DummyService.cancelled(name));
 
-//            Next may fails. Server can be restarted on unstable topology.
-//            assertEquals(name, totalInstances, DummyService.started(name));
-//            assertEquals(name, 0, DummyService.cancelled(name));
-
             checkCount(name, g.services().serviceDescriptors(), 
totalInstances);
         }
         finally {

Reply via email to