You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/08/12 09:49:50 UTC

[GitHub] [ignite] Vladsz83 commented on a change in pull request #8142: Fix measuring timers in discovery tests

Vladsz83 commented on a change in pull request #8142:
URL: https://github.com/apache/ignite/pull/8142#discussion_r469141458



##########
File path: modules/ducktests/tests/ignitetest/tests/discovery_test.py
##########
@@ -117,46 +163,81 @@ def __basic_test__(self, version, with_zk=False):
 
         start = self.monotonic()
         self.servers.start()
-        data = {'Ignite cluster start time (s)': self.monotonic() - start}
+        data = {'Ignite cluster start time (s)': round(self.monotonic() - start, 1)}
         self.stage("Topology is ready")
 
-        # Node failure detection
-        fail_node, survived_node = self.choose_random_node_to_kill(self.servers)
+        if nodes_to_kill > self.servers.num_nodes - 1 or coordinator and nodes_to_kill > 1:
+            raise Exception("Too many nodes to kill: " + str(nodes_to_kill))
+
+        if coordinator:
+            node_chooser = lambda nodes: \
+                next(node for node in nodes if node.discovery_info().node_id == nodes[0].discovery_info().coordinator)
+        else:
+            node_chooser = lambda nodes: \
+                random.sample([n for n in self.servers.nodes if n.discovery_info().node_id !=
+                               self.servers.nodes[0].discovery_info().coordinator], nodes_to_kill)
 
-        data["nodes"] = [node.node_id() for node in self.servers.nodes]
+        failed_nodes, survived_node = self.choose_node_to_kill(self.servers.nodes, node_chooser)
 
-        disco_infos = []
-        for node in self.servers.nodes:
-            disco_info = node.discovery_info()
-            disco_infos.append({
-                "id": disco_info.node_id,
-                "consistent_id": disco_info.consistent_id,
-                "coordinator": disco_info.coordinator,
-                "order": disco_info.order,
-                "int_order": disco_info.int_order,
-                "is_client": disco_info.is_client
-            })
+        ids_to_wait = [node.discovery_info().node_id for node in failed_nodes]
 
-        data["node_disco_info"] = disco_infos
+        self.stage("Stopping " + str(len(failed_nodes)) + " nodes.")
 
-        self.servers.stop_node(fail_node, clean_shutdown=False)
+        first_terminated = self.servers.stop_nodes_async(failed_nodes, clean_shutdown=False, wait_for_stop=False)
 
-        start = self.monotonic()
-        self.servers.await_event_on_node("Node FAILED", random.choice(survived_node), 60, True)
+        self.stage("Waiting for failure detection of " + str(len(failed_nodes)) + " nodes.")
+
+        # Keeps dates of logged node failures.
+        last_failure_detected = 0
+        logged_timestamps = []
+
+        for failed_id in ids_to_wait:
+            pattern = "Node FAILED: " + ("ZookeeperClusterNode" if with_zk else "TcpDiscoveryNode") + " \\[id=" \

Review comment:
       Fixed




----------------------------------------------------------------
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