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



##########
File path: modules/ducktests/tests/ignitetest/tests/discovery_test.py
##########
@@ -88,99 +93,100 @@ def __init__(self, test_context):
 
     @cluster(num_nodes=MAX_CONTAINERS)
     @ignite_versions(str(DEV_BRANCH), str(LATEST))
-    @matrix(nodes_to_kill=[1, 2], failure_detection_timeout=[FAILURE_TIMEOUT],
-            load_type=[ClusterLoad.NONE, ClusterLoad.ATOMIC, 
ClusterLoad.TRANSACTIONAL])
-    def test_nodes_fail_not_sequential_tcp(self, ignite_version, 
nodes_to_kill, load_type, failure_detection_timeout):
+    @matrix(nodes_to_kill=[1, 2], load_type=[ClusterLoad.NONE, 
ClusterLoad.ATOMIC, ClusterLoad.TRANSACTIONAL])
+    def test_nodes_fail_not_sequential_tcp(self, ignite_version, 
nodes_to_kill, load_type):
         """
         Test nodes failure scenario with TcpDiscoverySpi not allowing nodes to 
fail in a row.
         """
         test_config = 
DiscoveryTestConfig(version=IgniteVersion(ignite_version), 
nodes_to_kill=nodes_to_kill,
-                                          
load_type=ClusterLoad.construct_from(load_type), sequential_failure=False,
-                                          
failure_detection_timeout=failure_detection_timeout)
+                                          
load_type=ClusterLoad.construct_from(load_type), sequential_failure=False)
 
         return self._perform_node_fail_scenario(test_config)
 
     @cluster(num_nodes=MAX_CONTAINERS)
     @ignite_versions(str(DEV_BRANCH), str(LATEST))
-    @matrix(load_type=[ClusterLoad.NONE, ClusterLoad.ATOMIC, 
ClusterLoad.TRANSACTIONAL],
-            failure_detection_timeout=[FAILURE_TIMEOUT])
-    def test_2_nodes_fail_sequential_tcp(self, ignite_version, load_type, 
failure_detection_timeout):
+    @matrix(load_type=[ClusterLoad.NONE, ClusterLoad.ATOMIC, 
ClusterLoad.TRANSACTIONAL])
+    def test_2_nodes_fail_sequential_tcp(self, ignite_version, load_type):
         """
         Test 2 nodes sequential failure scenario with TcpDiscoverySpi.
         """
         test_config = 
DiscoveryTestConfig(version=IgniteVersion(ignite_version), nodes_to_kill=2,
-                                          
load_type=ClusterLoad.construct_from(load_type), sequential_failure=True,
-                                          
failure_detection_timeout=failure_detection_timeout)
+                                          
load_type=ClusterLoad.construct_from(load_type), sequential_failure=True)
 
         return self._perform_node_fail_scenario(test_config)
 
     @cluster(num_nodes=MAX_CONTAINERS)
     @version_if(lambda version: version != V_2_8_0)  # ignite-zookeeper 
package is broken in 2.8.0
     @ignite_versions(str(DEV_BRANCH), str(LATEST))
-    @matrix(nodes_to_kill=[1, 2], failure_detection_timeout=[FAILURE_TIMEOUT],
-            load_type=[ClusterLoad.NONE, ClusterLoad.ATOMIC, 
ClusterLoad.TRANSACTIONAL])
-    def test_nodes_fail_not_sequential_zk(self, ignite_version, nodes_to_kill, 
load_type, failure_detection_timeout):
+    @matrix(nodes_to_kill=[1, 2], load_type=[ClusterLoad.NONE, 
ClusterLoad.ATOMIC, ClusterLoad.TRANSACTIONAL])
+    def test_nodes_fail_not_sequential_zk(self, ignite_version, nodes_to_kill, 
load_type):
         """
         Test node failure scenario with ZooKeeperSpi not allowing nodes to 
fail in a row.
         """
         test_config = 
DiscoveryTestConfig(version=IgniteVersion(ignite_version), 
nodes_to_kill=nodes_to_kill,
                                           
load_type=ClusterLoad.construct_from(load_type), sequential_failure=False,
-                                          with_zk=True, 
failure_detection_timeout=failure_detection_timeout)
+                                          with_zk=True)
 
         return self._perform_node_fail_scenario(test_config)
 
     @cluster(num_nodes=MAX_CONTAINERS)
     @version_if(lambda version: version != V_2_8_0)  # ignite-zookeeper 
package is broken in 2.8.0
     @ignite_versions(str(DEV_BRANCH), str(LATEST))
-    @matrix(load_type=[ClusterLoad.NONE, ClusterLoad.ATOMIC, 
ClusterLoad.TRANSACTIONAL],
-            failure_detection_timeout=[FAILURE_TIMEOUT])
-    def test_2_nodes_fail_sequential_zk(self, ignite_version, load_type, 
failure_detection_timeout):
+    @matrix(load_type=[ClusterLoad.NONE, ClusterLoad.ATOMIC, 
ClusterLoad.TRANSACTIONAL])
+    def test_2_nodes_fail_sequential_zk(self, ignite_version, load_type):
         """
         Test node failure scenario with ZooKeeperSpi not allowing to fail 
nodes in a row.
         """
         test_config = 
DiscoveryTestConfig(version=IgniteVersion(ignite_version), nodes_to_kill=2,
                                           
load_type=ClusterLoad.construct_from(load_type), sequential_failure=True,
-                                          with_zk=True, 
failure_detection_timeout=failure_detection_timeout)
+                                          with_zk=True)
 
         return self._perform_node_fail_scenario(test_config)
 
     def _perform_node_fail_scenario(self, test_config):
-        max_containers = len(self.test_context.cluster)
+        failure_detection_timeout = 
self._global_int(self.GLOBAL_DETECTION_TIMEOUT, self.DEFAULT_DETECTION_TIMEOUT)
 
         # One node is required to detect the failure.
-        assert max_containers >= 1 + test_config.nodes_to_kill + (
-            DiscoveryTest.ZOOKEEPER_NODES if test_config.with_zk else 0) + (
-                   0 if test_config.load_type == ClusterLoad.NONE else 1), 
"Few required containers: " + \
-                                                                           
str(max_containers) + ". Check the params."
+        assert len(self.test_context.cluster) >= 1 + test_config.nodes_to_kill 
+ (
+            self.ZOOKEEPER_NODES if test_config.with_zk else 0), \
+            f"Few required containers: {len(self.test_context.cluster)}. Check 
the params."
 
-        self.logger.info("Starting on " + str(max_containers) + " maximal 
containers.")
+        self.logger.info("Starting on " + str(len(self.test_context.cluster)) 
+ " maximal containers.")
+        self.logger.info(f"{self.GLOBAL_DETECTION_TIMEOUT}: 
{failure_detection_timeout}")
 
         results = {}
 
         modules = ['zookeeper'] if test_config.with_zk else None
 
         if test_config.with_zk:
-            zk_quorum = start_zookeeper(self.test_context, 
DiscoveryTest.ZOOKEEPER_NODES, test_config)
+            zk_quorum = start_zookeeper(self.test_context, 
self.ZOOKEEPER_NODES, failure_detection_timeout)
 
             discovery_spi = from_zookeeper_cluster(zk_quorum)
         else:
             discovery_spi = TcpDiscoverySpi()
 
+            if LATEST_2_7 < test_config.version < V_2_9_1:

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


Reply via email to