anton-vinogradov commented on a change in pull request #8522:
URL: https://github.com/apache/ignite/pull/8522#discussion_r570802220



##########
File path: modules/ducktests/tests/ignitetest/tests/discovery_test.py
##########
@@ -213,36 +215,37 @@ def _perform_node_fail_scenario(self, test_config):
                       "targetNodes": tran_nodes,
                       "transactional": bool(tran_nodes)}
 
-            start_load_app(self.test_context, ignite_config=load_config, 
params=params, modules=modules)
+            start_load_app(self.test_context, load_config, params, modules)
 
+        # Minimal detection timeout is failure_detection_timeout * 2. Let's 
more to capture also 'bad' results.
         results.update(self._simulate_and_detect_failure(servers, failed_nodes,
-                                                         
test_config.failure_detection_timeout * 4,
+                                                         0.004 * 
ignite_config.failure_detection_timeout,

Review comment:
       let's define what is 0.004 properly.

##########
File path: modules/ducktests/tests/ignitetest/services/ignite.py
##########
@@ -90,3 +91,19 @@ def get_event_time(service, log_node, log_pattern, 
from_the_beginning=True, time
 
     return datetime.strptime(re.match("^\\[[^\\[]+\\]", 
stdout.read().decode("utf-8")).group(),
                              "[%Y-%m-%d %H:%M:%S,%f]")
+
+
+def exec_command(node, cmd):
+    """Executes the command passed on the given node and returns result as 
string."""
+    return str(node.account.ssh_client.exec_command(cmd)[1].read(), 
sys.getdefaultencoding())
+
+
+def node_id(node):
+    """
+    Returns node id from its log if started.
+    This is a remote call. Reuse its results if possible.
+    """
+    regexp = "^>>> Local node \\[ID=([^,]+),.+$"
+    cmd = "grep -E '%s' %s | sed -r 's/%s/\\1/'" % (regexp, node.log_file, 
regexp)
+
+    return exec_command(node, cmd).strip().lower()

Review comment:
       Why located not at IgniteAwareService?

##########
File path: modules/ducktests/tests/ignitetest/utils/ignite_test.py
##########
@@ -55,3 +55,11 @@ def tearDown(self):
         self.logger.debug("All services killed.")
 
         super().tearDown()
+
+    def _global_param(self, param_name, default=None):
+        """Reads global parameter passed to the test suite."""
+        return self.test_context.globals.get(param_name, default)
+
+    def _global_int(self, param_name, default: int = None):

Review comment:
       1) any reason to start a name with "_"?
   2) "default=None" or "int = None", please format the code.




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