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



##########
File path: modules/ducktests/tests/ignitetest/tests/discovery_test.py
##########
@@ -230,17 +218,38 @@ def __simulate_nodes_failure(self, version, properties, 
nodes_to_kill=1):
     def __failed_pattern(failed_node_id):
         return "Node FAILED: .\\{1,\\}Node \\[id=" + failed_node_id
 
-    def __choose_node_to_kill(self, nodes_to_kill):
+    def __choose_node_to_kill(self, kill_coordinator, nodes_to_kill):
         nodes = self.servers.nodes
         coordinator = nodes[0].discovery_info().coordinator
+        to_kill = []
 
-        if nodes_to_kill < 1:
-            to_kill = next(node for node in nodes if 
node.discovery_info().node_id == coordinator)
-        else:
-            to_kill = random.sample([n for n in nodes if 
n.discovery_info().node_id != coordinator], nodes_to_kill)
+        if kill_coordinator:
+            to_kill.append(next(node for node in nodes if 
node.discovery_info().node_id == coordinator))
 
-        to_kill = [to_kill] if not isinstance(to_kill, list) else to_kill
+        if nodes_to_kill > 0:
+            choice = random.sample([n for n in nodes if 
n.discovery_info().node_id != coordinator], nodes_to_kill)
+            to_kill.extend([choice] if not isinstance(choice, list) else 
choice)
 
         survive = random.choice([node for node in self.servers.nodes if node 
not in to_kill])
 
         return to_kill, survive
+
+    def __start_loading(self, ignite_version, properties, modules, wait_sec=0):
+        self.stage("Starting loading")
+
+        self.loader = IgniteApplicationService(
+            self.test_context,
+            
java_class_name="org.apache.ignite.internal.ducktest.tests.DataGenerationApplication",
+            version=ignite_version,
+            modules=modules,
+            properties=properties,
+            params={"cacheName": "test-cache", "range": self.__DATA_AMOUNT, 
"infinite": True, "optimized": False})
+
+        self.loader.start()
+
+        for node in self.loader.nodes:
+            self.loader.await_event_on_node("Begin generating data in 
background...", node, 10, True, 1)
+
+        if wait_sec > 0:
+            self.logger.info("Waiting for the data load for " + str(wait_sec) 
+ " seconds...")

Review comment:
       Didn't catch you




----------------------------------------------------------------
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:
[email protected]


Reply via email to