ignite-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [ignite] dgarus commented on a change in pull request #6927: IGNITE-12212: Cluster nodes system view.
Date Wed, 09 Oct 2019 08:31:17 GMT
dgarus commented on a change in pull request #6927: IGNITE-12212: Cluster nodes system view.
URL: https://github.com/apache/ignite/pull/6927#discussion_r332885282
 
 

 ##########
 File path: modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java
 ##########
 @@ -461,6 +464,63 @@ public void testClientsConnections() throws Exception {
         }
     }
 
+    /** */
+    @Test
+    public void testNodes() throws Exception {
+        try(IgniteEx g1 = startGrid(0)) {
+            SystemView<ClusterNodeView> nodes = g1.context().systemView().view(NODES_SYS_VIEW);
+
+            assertEquals(1, nodes.size());
+
+            checkNodeView(nodes.iterator().next(), g1.localNode(), true);
+
+            try(IgniteEx g2 = startGrid(1)) {
+                awaitPartitionMapExchange();
+
+                assertEquals(2, nodes.size());
+
+                boolean found = false;
+
+                for (ClusterNodeView node : nodes) {
+                    if (!node.nodeId().equals(g2.localNode().id()))
+                        continue;
+
+                    checkNodeView(node, g2.localNode(), false);
+
+                    found = true;
+
+                    break;
+                }
+
+                assertTrue(found);
+
+                SystemView<ClusterNodeView> nodes2 = g2.context().systemView().view(NODES_SYS_VIEW);
+
+                assertEquals(2, nodes2.size());
+
+                for (ClusterNodeView node : nodes2) {
+                    if(node.nodeId().equals(g2.localNode().id()))
+                        checkNodeView(node, g2.localNode(), true);
+                    else
+                        checkNodeView(node, g1.localNode(), false);
+                }
+            }
+        }
 
 Review comment:
   we should check that views size is 0

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message