From b60085ded1ec65bb8d7e64a31d289f711390b85f Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Wed, 14 Oct 2020 23:31:09 +0300 Subject: [PATCH 01/20] simple test client start and stop in loop --- .../tests/start_stop_client/SimpleClient.java | 70 ++++++++++ .../tests/ignitetest/services/ignite_app.py | 34 ++--- .../ignitetest/tests/client_in_out_test.py | 132 ++++++++++++++++++ 3 files changed, 217 insertions(+), 19 deletions(-) create mode 100644 modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/SimpleClient.java create mode 100644 modules/ducktests/tests/ignitetest/tests/client_in_out_test.py diff --git a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/SimpleClient.java b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/SimpleClient.java new file mode 100644 index 0000000000000..4b2c8272f0574 --- /dev/null +++ b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/SimpleClient.java @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.ducktest.tests.start_stop_client; + +import java.util.Optional; +import java.util.UUID; +import com.fasterxml.jackson.databind.JsonNode; +import org.apache.ignite.IgniteCache; +import org.apache.ignite.cache.CacheAtomicityMode; +import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication; + +/** + * Java client. Tx put operation + */ +public class SimpleClient extends IgniteAwareApplication { + /** {@inheritDoc} */ + @Override protected void run(JsonNode jsonNode) throws Exception { + String cacheName = Optional.ofNullable(jsonNode.get("cacheName")) + .map(JsonNode::asText) + .orElse("default-cache-name"); + long pacing = Optional.ofNullable(jsonNode.get("pacing")) + .map(JsonNode::asLong) + .orElse(0l); + + log.info("Test props:" + + " cacheName=" + cacheName + + " pacing=" + pacing); + + CacheConfiguration cacheConfiguration = new CacheConfiguration() + .setBackups(2) + .setName(cacheName) + .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); + + IgniteCache cache = ignite.getOrCreateCache(cacheConfiguration); + log.info("Node name: " + ignite.name() + " starting cache operations."); + + markInitialized(); + + while (!terminated()) { + UUID key = UUID.randomUUID(); + + long startTime = System.nanoTime(); + + cache.put(key,key); + + long resultTime = System.nanoTime() - startTime; + + log.info("Success put key=" + key + " value=" + key + " latency: " + resultTime + "ns."); + + Thread.sleep(pacing); + } + markFinished(); + } +} diff --git a/modules/ducktests/tests/ignitetest/services/ignite_app.py b/modules/ducktests/tests/ignitetest/services/ignite_app.py index 8fbf0351a66a5..8315a742280aa 100644 --- a/modules/ducktests/tests/ignitetest/services/ignite_app.py +++ b/modules/ducktests/tests/ignitetest/services/ignite_app.py @@ -34,9 +34,9 @@ class IgniteApplicationService(IgniteAwareService): SERVICE_JAVA_CLASS_NAME = "org.apache.ignite.internal.ducktest.utils.IgniteAwareApplicationService" # pylint: disable=R0913 - def __init__(self, context, config, java_class_name, params="", timeout_sec=60, modules=None, + def __init__(self, context, config, java_class_name, num_nodes=1, params="", timeout_sec=60, modules=None, servicejava_class_name=SERVICE_JAVA_CLASS_NAME, jvm_opts=None, start_ignite=True): - super().__init__(context, config, 1, modules=modules, servicejava_class_name=servicejava_class_name, + super().__init__(context, config, num_nodes, modules=modules, servicejava_class_name=servicejava_class_name, java_class_name=java_class_name, params=params, jvm_opts=jvm_opts, start_ignite=start_ignite) self.servicejava_class_name = servicejava_class_name @@ -57,26 +57,22 @@ def stop_async(self, clean_shutdown=True): """ Stops node in async way. """ - self.logger.info("%s Stopping node %s" % (self.__class__.__name__, str(self.nodes[0].account))) - self.nodes[0].account.kill_java_processes(self.servicejava_class_name, clean_shutdown=clean_shutdown, - allow_fail=True) + for node in self.nodes: + self.logger.info("%s Stopping node %s" % (self.__class__.__name__, str(node.account))) + node.account.kill_java_processes(self.servicejava_class_name, clean_shutdown=clean_shutdown, + allow_fail=True) def await_stopped(self, timeout_sec=10): """ Awaits node stop finish. """ - stopped = self.wait_node(self.nodes[0], timeout_sec=timeout_sec) - assert stopped, "Node %s: did not stop within the specified timeout of %s seconds" % \ - (str(self.nodes[0].account), str(timeout_sec)) + for node in self.nodes: + stopped = self.wait_node(node, timeout_sec=timeout_sec) + assert stopped, "Node %s: did not stop within the specified timeout of %s seconds" % \ + (str(node.account), str(timeout_sec)) self.__check_status("IGNITE_APPLICATION_FINISHED", timeout=timeout_sec) - # pylint: disable=W0221 - def stop_node(self, node, clean_shutdown=True, timeout_sec=10): - assert node == self.nodes[0] - self.stop_async(clean_shutdown) - self.await_stopped(timeout_sec) - def __check_status(self, desired, timeout=1): self.await_event("%s\\|IGNITE_APPLICATION_BROKEN" % desired, timeout, from_the_beginning=True) @@ -121,10 +117,10 @@ def extract_results(self, name): """ res = [] - output = self.nodes[0].account.ssh_capture( - "grep '%s' %s" % (name + "->", self.STDOUT_STDERR_CAPTURE), allow_fail=False) - - for line in output: - res.append(re.search("%s(.*)%s" % (name + "->", "<-"), line).group(1)) + for node in self.nodes: + output = node.account.ssh_capture( + "grep '%s' %s" % (name + "->", self.STDOUT_STDERR_CAPTURE), allow_fail=False) + for line in output: + res.append(re.search("%s(.*)%s" % (name + "->", "<-"), line).group(1)) return res diff --git a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py new file mode 100644 index 0000000000000..8102574ff7b50 --- /dev/null +++ b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py @@ -0,0 +1,132 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +This module contains client tests +""" +import time +from ducktape.mark.resource import cluster +from ignitetest.services.ignite import IgniteService +from ignitetest.services.ignite_app import IgniteApplicationService +from ignitetest.services.utils.control_utility import ControlUtility +from ignitetest.services.utils.ignite_configuration.discovery import from_ignite_cluster +from ignitetest.services.utils.ignite_configuration import IgniteConfiguration +from ignitetest.utils import ignite_versions +from ignitetest.utils.ignite_test import IgniteTest +from ignitetest.utils.version import DEV_BRANCH, V_2_8_1, IgniteVersion + + +# pylint: disable=W0223 +class ClientTest(IgniteTest): + """ + CACHE_NAME - name of the cache to create for the test. + REPORT_NAME - the name of the tests. + PACING - the frequency of the operation on clients (ms). + JAVA_CLIENT_CLASS_NAME - running classname. + CLIENTS_WORK_TIME_S - clients working time (s). + STATIC_CLIENT_WORK_TIME_S - static client work time (s) + ITERATION_COUNT - the number of iterations of starting and stopping client nodes (s). + CLUSTER_NODES - cluster size. + STATIC_CLIENTS_NUM - the number of permanently employed clients. + TEMP_CLIENTS_NUM - number of clients who come log in and out. + """ + + CACHE_NAME = "simple-tx-cache" + PACING = 10 + JAVA_CLIENT_CLASS_NAME = "org.apache.ignite.internal.ducktest.tests.start_stop_client.SimpleClient" + + CLIENTS_WORK_TIME_S = 30 + STATIC_CLIENT_WORK_TIME_S = 30 + ITERATION_COUNT = 3 + CLUSTER_NODES = 7 + STATIC_CLIENTS_NUM = 2 + TEMP_CLIENTS_NUM = 3 + + @cluster(num_nodes=CLUSTER_NODES) + @ignite_versions(str(DEV_BRANCH), str(V_2_8_1)) + def test_ignite_start_stop(self, ignite_version): + """ + Start and stop clients test + """ + + servers_count = self.CLUSTER_NODES - self.STATIC_CLIENTS_NUM - self.TEMP_CLIENTS_NUM + + # Topology version after test. + current_top_v = servers_count + fin_top_ver = servers_count + 2 * self.STATIC_CLIENTS_NUM + 2 * self.ITERATION_COUNT * self.TEMP_CLIENTS_NUM + + server_cfg = IgniteConfiguration(version=IgniteVersion(ignite_version)) + ignite = IgniteService(self.test_context, server_cfg, num_nodes=servers_count) + control_utility = ControlUtility(ignite, self.test_context) + + client_cfg = server_cfg._replace(client_mode=True, discovery_spi=from_ignite_cluster(ignite)) + + static_clients = IgniteApplicationService( + self.test_context, + client_cfg, + java_class_name=self.JAVA_CLIENT_CLASS_NAME, + num_nodes=self.STATIC_CLIENTS_NUM, + params={"cacheName": self.CACHE_NAME, + "pacing": self.PACING}) + + temp_clients = IgniteApplicationService( + self.test_context, + client_cfg, + java_class_name=self.JAVA_CLIENT_CLASS_NAME, + num_nodes=self.TEMP_CLIENTS_NUM, + params={"cacheName": self.CACHE_NAME, + "pacing": self.PACING}) + + ignite.start() + + static_clients.start() + current_top_v += self.STATIC_CLIENTS_NUM + check_topology(control_utility, current_top_v) + + # Start stop temp_clients node. Check cluster. + for i in range(self.ITERATION_COUNT): + self.logger.debug(f'Starting iteration:{i}') + + time.sleep(self.CLIENTS_WORK_TIME_S) + + temp_clients.start() + + temp_clients.await_event(f'clients={self.STATIC_CLIENTS_NUM + self.TEMP_CLIENTS_NUM}', + timeout_sec=80, + from_the_beginning=True, + backoff_sec=1) + + current_top_v += self.TEMP_CLIENTS_NUM + check_topology(control_utility, current_top_v) + + time.sleep(self.CLIENTS_WORK_TIME_S) + temp_clients.stop() + + current_top_v += self.TEMP_CLIENTS_NUM + check_topology(control_utility, current_top_v) + + static_clients.stop() + + check_topology(control_utility, fin_top_ver) + + +def check_topology(control_utility, fin_top_ver): + """ + :param control_utility: control.sh + :param fin_top_ver: expected topology version + :return: + """ + top_ver = control_utility.cluster_state().topology_version + assert top_ver == fin_top_ver, f'cluster topology version={top_ver}, expected topology version={fin_top_ver}' From bc5a753b96aa101f31359f02f4e81b496a4329d6 Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Wed, 14 Oct 2020 23:58:58 +0300 Subject: [PATCH 02/20] fix assert --- modules/ducktests/tests/ignitetest/services/ignite_app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/ducktests/tests/ignitetest/services/ignite_app.py b/modules/ducktests/tests/ignitetest/services/ignite_app.py index 8315a742280aa..ca5d5e08c2234 100644 --- a/modules/ducktests/tests/ignitetest/services/ignite_app.py +++ b/modules/ducktests/tests/ignitetest/services/ignite_app.py @@ -73,6 +73,11 @@ def await_stopped(self, timeout_sec=10): self.__check_status("IGNITE_APPLICATION_FINISHED", timeout=timeout_sec) + # pylint: disable=W0221 + def stop_node(self, node, clean_shutdown=True, timeout_sec=10): + self.stop_async(clean_shutdown) + self.await_stopped(timeout_sec) + def __check_status(self, desired, timeout=1): self.await_event("%s\\|IGNITE_APPLICATION_BROKEN" % desired, timeout, from_the_beginning=True) From c29e52ca9e5b3367c71b3935a1aaa211ff9dc367 Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Thu, 15 Oct 2020 12:47:05 +0300 Subject: [PATCH 03/20] fix ignite_app.py --- .../tests/start_stop_client/SimpleClient.java | 21 +++++---------- .../tests/ignitetest/services/ignite_app.py | 2 +- .../ignitetest/tests/client_in_out_test.py | 26 ++++++++++--------- 3 files changed, 22 insertions(+), 27 deletions(-) diff --git a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/SimpleClient.java b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/SimpleClient.java index 4b2c8272f0574..da51837cf3f2d 100644 --- a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/SimpleClient.java +++ b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/SimpleClient.java @@ -21,8 +21,6 @@ import java.util.UUID; import com.fasterxml.jackson.databind.JsonNode; import org.apache.ignite.IgniteCache; -import org.apache.ignite.cache.CacheAtomicityMode; -import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication; /** @@ -31,9 +29,8 @@ public class SimpleClient extends IgniteAwareApplication { /** {@inheritDoc} */ @Override protected void run(JsonNode jsonNode) throws Exception { - String cacheName = Optional.ofNullable(jsonNode.get("cacheName")) - .map(JsonNode::asText) - .orElse("default-cache-name"); + String cacheName = jsonNode.get("cacheName").asText(); + long pacing = Optional.ofNullable(jsonNode.get("pacing")) .map(JsonNode::asLong) .orElse(0l); @@ -42,29 +39,25 @@ public class SimpleClient extends IgniteAwareApplication { " cacheName=" + cacheName + " pacing=" + pacing); - CacheConfiguration cacheConfiguration = new CacheConfiguration() - .setBackups(2) - .setName(cacheName) - .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); - - IgniteCache cache = ignite.getOrCreateCache(cacheConfiguration); + IgniteCache cache = ignite.getOrCreateCache(cacheName); log.info("Node name: " + ignite.name() + " starting cache operations."); markInitialized(); while (!terminated()) { - UUID key = UUID.randomUUID(); + UUID uuid = UUID.randomUUID(); long startTime = System.nanoTime(); - cache.put(key,key); + cache.put(uuid, uuid); long resultTime = System.nanoTime() - startTime; - log.info("Success put key=" + key + " value=" + key + " latency: " + resultTime + "ns."); + log.info("Success put, latency: " + resultTime + "ns."); Thread.sleep(pacing); } + markFinished(); } } diff --git a/modules/ducktests/tests/ignitetest/services/ignite_app.py b/modules/ducktests/tests/ignitetest/services/ignite_app.py index ca5d5e08c2234..7a6089d812958 100644 --- a/modules/ducktests/tests/ignitetest/services/ignite_app.py +++ b/modules/ducktests/tests/ignitetest/services/ignite_app.py @@ -74,7 +74,7 @@ def await_stopped(self, timeout_sec=10): self.__check_status("IGNITE_APPLICATION_FINISHED", timeout=timeout_sec) # pylint: disable=W0221 - def stop_node(self, node, clean_shutdown=True, timeout_sec=10): + def stop(self, clean_shutdown=True, timeout_sec=60): self.stop_async(clean_shutdown) self.await_stopped(timeout_sec) diff --git a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py index 8102574ff7b50..59441e304d7bd 100644 --- a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py +++ b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py @@ -21,6 +21,7 @@ from ignitetest.services.ignite import IgniteService from ignitetest.services.ignite_app import IgniteApplicationService from ignitetest.services.utils.control_utility import ControlUtility +from ignitetest.services.utils.ignite_configuration.cache import CacheConfiguration from ignitetest.services.utils.ignite_configuration.discovery import from_ignite_cluster from ignitetest.services.utils.ignite_configuration import IgniteConfiguration from ignitetest.utils import ignite_versions @@ -36,7 +37,6 @@ class ClientTest(IgniteTest): PACING - the frequency of the operation on clients (ms). JAVA_CLIENT_CLASS_NAME - running classname. CLIENTS_WORK_TIME_S - clients working time (s). - STATIC_CLIENT_WORK_TIME_S - static client work time (s) ITERATION_COUNT - the number of iterations of starting and stopping client nodes (s). CLUSTER_NODES - cluster size. STATIC_CLIENTS_NUM - the number of permanently employed clients. @@ -48,7 +48,6 @@ class ClientTest(IgniteTest): JAVA_CLIENT_CLASS_NAME = "org.apache.ignite.internal.ducktest.tests.start_stop_client.SimpleClient" CLIENTS_WORK_TIME_S = 30 - STATIC_CLIENT_WORK_TIME_S = 30 ITERATION_COUNT = 3 CLUSTER_NODES = 7 STATIC_CLIENTS_NUM = 2 @@ -65,13 +64,16 @@ def test_ignite_start_stop(self, ignite_version): # Topology version after test. current_top_v = servers_count - fin_top_ver = servers_count + 2 * self.STATIC_CLIENTS_NUM + 2 * self.ITERATION_COUNT * self.TEMP_CLIENTS_NUM + fin_top_ver = servers_count + (2 * self.STATIC_CLIENTS_NUM) + (2 * self.ITERATION_COUNT * self.TEMP_CLIENTS_NUM) - server_cfg = IgniteConfiguration(version=IgniteVersion(ignite_version)) + server_cfg = IgniteConfiguration( + version=IgniteVersion(ignite_version), + caches=[CacheConfiguration(name=self.CACHE_NAME, backups=1, atomicity_mode='TRANSACTIONAL')] + ) ignite = IgniteService(self.test_context, server_cfg, num_nodes=servers_count) control_utility = ControlUtility(ignite, self.test_context) - client_cfg = server_cfg._replace(client_mode=True, discovery_spi=from_ignite_cluster(ignite)) + client_cfg = server_cfg._replace(client_mode=True) static_clients = IgniteApplicationService( self.test_context, @@ -92,12 +94,13 @@ def test_ignite_start_stop(self, ignite_version): ignite.start() static_clients.start() + current_top_v += self.STATIC_CLIENTS_NUM check_topology(control_utility, current_top_v) - # Start stop temp_clients node. Check cluster. + # Start / stop temp_clients node. Check cluster. for i in range(self.ITERATION_COUNT): - self.logger.debug(f'Starting iteration:{i}') + self.logger.debug(f'Starting iteration: {i}.') time.sleep(self.CLIENTS_WORK_TIME_S) @@ -122,11 +125,10 @@ def test_ignite_start_stop(self, ignite_version): check_topology(control_utility, fin_top_ver) -def check_topology(control_utility, fin_top_ver): +def check_topology(control_utility: ControlUtility, fin_top_ver: int): """ - :param control_utility: control.sh - :param fin_top_ver: expected topology version - :return: + Check current topology version. """ top_ver = control_utility.cluster_state().topology_version - assert top_ver == fin_top_ver, f'cluster topology version={top_ver}, expected topology version={fin_top_ver}' + assert top_ver == fin_top_ver, f'Cluster current topology version={top_ver}, ' \ + f'expected topology version={fin_top_ver}.' From 9eb6ff703ce582f6e20ec0aa070ff357e7e37c73 Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Thu, 15 Oct 2020 15:26:19 +0300 Subject: [PATCH 04/20] fix unused varilable --- modules/ducktests/tests/ignitetest/tests/client_in_out_test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py index 59441e304d7bd..fa0eb62d40143 100644 --- a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py +++ b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py @@ -22,7 +22,6 @@ from ignitetest.services.ignite_app import IgniteApplicationService from ignitetest.services.utils.control_utility import ControlUtility from ignitetest.services.utils.ignite_configuration.cache import CacheConfiguration -from ignitetest.services.utils.ignite_configuration.discovery import from_ignite_cluster from ignitetest.services.utils.ignite_configuration import IgniteConfiguration from ignitetest.utils import ignite_versions from ignitetest.utils.ignite_test import IgniteTest From 5985a1c213d36f3d78473924cad1169e419f87d7 Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Thu, 15 Oct 2020 15:39:48 +0300 Subject: [PATCH 05/20] add test in fast suit --- modules/ducktests/tests/ignitetest/tests/suites/fast_suite.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/ducktests/tests/ignitetest/tests/suites/fast_suite.yml b/modules/ducktests/tests/ignitetest/tests/suites/fast_suite.yml index 698c1d84c74e0..33ce3bf7bb1e5 100644 --- a/modules/ducktests/tests/ignitetest/tests/suites/fast_suite.yml +++ b/modules/ducktests/tests/ignitetest/tests/suites/fast_suite.yml @@ -27,3 +27,6 @@ cellular_affinity: rebalance: - ../add_node_rebalance_test.py +clients: + - ../client_in_out_test.py + From c11da912c65d648eb4dc7e09e21d7c11cd4a0c9b Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Thu, 15 Oct 2020 16:05:03 +0300 Subject: [PATCH 06/20] fix abstract method --- .../tests/ignitetest/services/ignite_app.py | 24 ++++++++++++------- .../ignitetest/tests/client_in_out_test.py | 2 +- .../ignitetest/tests/suites/fast_suite.yml | 1 + 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/modules/ducktests/tests/ignitetest/services/ignite_app.py b/modules/ducktests/tests/ignitetest/services/ignite_app.py index 7a6089d812958..853e4c1f3a9f6 100644 --- a/modules/ducktests/tests/ignitetest/services/ignite_app.py +++ b/modules/ducktests/tests/ignitetest/services/ignite_app.py @@ -53,14 +53,25 @@ def start(self): self.__check_status("IGNITE_APPLICATION_INITIALIZED", timeout=self.timeout_sec) + # pylint: disable=W0221 + def stop(self, clean_shutdown=True, timeout_sec=60): + self.stop_async(clean_shutdown) + self.await_stopped(timeout_sec) + def stop_async(self, clean_shutdown=True): """ - Stops node in async way. + Stop in async way. """ for node in self.nodes: - self.logger.info("%s Stopping node %s" % (self.__class__.__name__, str(node.account))) - node.account.kill_java_processes(self.servicejava_class_name, clean_shutdown=clean_shutdown, - allow_fail=True) + self.stop_node(node=node, clean_shutdown=clean_shutdown) + + def stop_node(self, node, clean_shutdown=True): + """ + Stop node in async way. + """ + self.logger.info("%s Stopping node %s" % (self.__class__.__name__, str(node.account))) + node.account.kill_java_processes(self.servicejava_class_name, clean_shutdown=clean_shutdown, + allow_fail=True) def await_stopped(self, timeout_sec=10): """ @@ -73,11 +84,6 @@ def await_stopped(self, timeout_sec=10): self.__check_status("IGNITE_APPLICATION_FINISHED", timeout=timeout_sec) - # pylint: disable=W0221 - def stop(self, clean_shutdown=True, timeout_sec=60): - self.stop_async(clean_shutdown) - self.await_stopped(timeout_sec) - def __check_status(self, desired, timeout=1): self.await_event("%s\\|IGNITE_APPLICATION_BROKEN" % desired, timeout, from_the_beginning=True) diff --git a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py index fa0eb62d40143..3a0f9474f64c0 100644 --- a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py +++ b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py @@ -56,7 +56,7 @@ class ClientTest(IgniteTest): @ignite_versions(str(DEV_BRANCH), str(V_2_8_1)) def test_ignite_start_stop(self, ignite_version): """ - Start and stop clients test + Start and stop clients test. """ servers_count = self.CLUSTER_NODES - self.STATIC_CLIENTS_NUM - self.TEMP_CLIENTS_NUM diff --git a/modules/ducktests/tests/ignitetest/tests/suites/fast_suite.yml b/modules/ducktests/tests/ignitetest/tests/suites/fast_suite.yml index 33ce3bf7bb1e5..714a9af43e840 100644 --- a/modules/ducktests/tests/ignitetest/tests/suites/fast_suite.yml +++ b/modules/ducktests/tests/ignitetest/tests/suites/fast_suite.yml @@ -27,6 +27,7 @@ cellular_affinity: rebalance: - ../add_node_rebalance_test.py + clients: - ../client_in_out_test.py From 4a7580bc507ca73a746a57b5d1219b5182d4b41b Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Thu, 15 Oct 2020 16:07:17 +0300 Subject: [PATCH 07/20] fix abstract method --- modules/ducktests/tests/ignitetest/tests/client_in_out_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py index 3a0f9474f64c0..7f0b1ab19d125 100644 --- a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py +++ b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py @@ -56,7 +56,7 @@ class ClientTest(IgniteTest): @ignite_versions(str(DEV_BRANCH), str(V_2_8_1)) def test_ignite_start_stop(self, ignite_version): """ - Start and stop clients test. + Test for starting and stopping fat clients. """ servers_count = self.CLUSTER_NODES - self.STATIC_CLIENTS_NUM - self.TEMP_CLIENTS_NUM From b89c98f257d6a8ca6a4f41be431a014b9182b354 Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Fri, 16 Oct 2020 14:53:04 +0300 Subject: [PATCH 08/20] change classname --- ...impleClient.java => IgniteCachePutClient.java} | 2 +- .../tests/ignitetest/services/ignite_app.py | 15 +++++++++------ .../tests/ignitetest/tests/client_in_out_test.py | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) rename modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/{SimpleClient.java => IgniteCachePutClient.java} (96%) diff --git a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/SimpleClient.java b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/IgniteCachePutClient.java similarity index 96% rename from modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/SimpleClient.java rename to modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/IgniteCachePutClient.java index da51837cf3f2d..b0ecd63d8c881 100644 --- a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/SimpleClient.java +++ b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/IgniteCachePutClient.java @@ -26,7 +26,7 @@ /** * Java client. Tx put operation */ -public class SimpleClient extends IgniteAwareApplication { +public class IgniteCachePutClient extends IgniteAwareApplication { /** {@inheritDoc} */ @Override protected void run(JsonNode jsonNode) throws Exception { String cacheName = jsonNode.get("cacheName").asText(); diff --git a/modules/ducktests/tests/ignitetest/services/ignite_app.py b/modules/ducktests/tests/ignitetest/services/ignite_app.py index 853e4c1f3a9f6..c346ca6cec70f 100644 --- a/modules/ducktests/tests/ignitetest/services/ignite_app.py +++ b/modules/ducktests/tests/ignitetest/services/ignite_app.py @@ -53,11 +53,6 @@ def start(self): self.__check_status("IGNITE_APPLICATION_INITIALIZED", timeout=self.timeout_sec) - # pylint: disable=W0221 - def stop(self, clean_shutdown=True, timeout_sec=60): - self.stop_async(clean_shutdown) - self.await_stopped(timeout_sec) - def stop_async(self, clean_shutdown=True): """ Stop in async way. @@ -67,7 +62,7 @@ def stop_async(self, clean_shutdown=True): def stop_node(self, node, clean_shutdown=True): """ - Stop node in async way. + Stops node in async way. """ self.logger.info("%s Stopping node %s" % (self.__class__.__name__, str(node.account))) node.account.kill_java_processes(self.servicejava_class_name, clean_shutdown=clean_shutdown, @@ -84,6 +79,14 @@ def await_stopped(self, timeout_sec=10): self.__check_status("IGNITE_APPLICATION_FINISHED", timeout=timeout_sec) + # pylint: disable=W0221 + def stop(self, clean_shutdown=True, timeout_sec=10): + """ + Stop services. + """ + self.stop_async(clean_shutdown) + self.await_stopped(timeout_sec) + def __check_status(self, desired, timeout=1): self.await_event("%s\\|IGNITE_APPLICATION_BROKEN" % desired, timeout, from_the_beginning=True) diff --git a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py index 7f0b1ab19d125..1309070e7463d 100644 --- a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py +++ b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py @@ -44,7 +44,7 @@ class ClientTest(IgniteTest): CACHE_NAME = "simple-tx-cache" PACING = 10 - JAVA_CLIENT_CLASS_NAME = "org.apache.ignite.internal.ducktest.tests.start_stop_client.SimpleClient" + JAVA_CLIENT_CLASS_NAME = "org.apache.ignite.internal.ducktest.tests.start_stop_client.IgniteCachePutClient" CLIENTS_WORK_TIME_S = 30 ITERATION_COUNT = 3 From 1831fd52dc86ea9fa360f0434883a8ecba2c0738 Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Fri, 16 Oct 2020 14:59:16 +0300 Subject: [PATCH 09/20] check result assert --- modules/ducktests/tests/ignitetest/services/ignite_app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ducktests/tests/ignitetest/services/ignite_app.py b/modules/ducktests/tests/ignitetest/services/ignite_app.py index c346ca6cec70f..d9dc235e411e2 100644 --- a/modules/ducktests/tests/ignitetest/services/ignite_app.py +++ b/modules/ducktests/tests/ignitetest/services/ignite_app.py @@ -120,7 +120,8 @@ def extract_result(self, name): """ results = self.extract_results(name) - assert len(results) <= 1, f"Expected exactly one result occurence, {len(results)} found." + assert len(results) <= len(self.nodes), f"Expected exactly {len(self.nodes)} occurence," \ + f" but found {len(results)}." return results[0] if results else "" From f81b0ba136523cadb07f2493159602c7be6970a8 Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Mon, 19 Oct 2020 20:08:37 +0300 Subject: [PATCH 10/20] add kill node test --- .idea/inspectionProfiles/Project_Default.xml | 1461 ++++++++--------- .../tests/ignitetest/services/ignite_app.py | 1 + .../ignitetest/tests/client_in_out_test.py | 105 +- 3 files changed, 802 insertions(+), 765 deletions(-) diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 23515edc761bf..d551eaf29f07a 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -1,776 +1,771 @@ - - + \ No newline at end of file diff --git a/modules/ducktests/tests/ignitetest/services/ignite_app.py b/modules/ducktests/tests/ignitetest/services/ignite_app.py index d9dc235e411e2..afbedd0557b3b 100644 --- a/modules/ducktests/tests/ignitetest/services/ignite_app.py +++ b/modules/ducktests/tests/ignitetest/services/ignite_app.py @@ -60,6 +60,7 @@ def stop_async(self, clean_shutdown=True): for node in self.nodes: self.stop_node(node=node, clean_shutdown=clean_shutdown) + # pylint: disable=W0221 def stop_node(self, node, clean_shutdown=True): """ Stops node in async way. diff --git a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py index 1309070e7463d..fb201e367a49a 100644 --- a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py +++ b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py @@ -17,7 +17,7 @@ This module contains client tests """ import time -from ducktape.mark.resource import cluster +from ducktape.mark import parametrize from ignitetest.services.ignite import IgniteService from ignitetest.services.ignite_app import IgniteApplicationService from ignitetest.services.utils.control_utility import ControlUtility @@ -31,44 +31,71 @@ # pylint: disable=W0223 class ClientTest(IgniteTest): """ + cluster - cluster size CACHE_NAME - name of the cache to create for the test. - REPORT_NAME - the name of the tests. PACING - the frequency of the operation on clients (ms). JAVA_CLIENT_CLASS_NAME - running classname. - CLIENTS_WORK_TIME_S - clients working time (s). - ITERATION_COUNT - the number of iterations of starting and stopping client nodes (s). - CLUSTER_NODES - cluster size. - STATIC_CLIENTS_NUM - the number of permanently employed clients. - TEMP_CLIENTS_NUM - number of clients who come log in and out. + + client_work_time - clients working time (s). + iteration_count - the number of iterations of starting and stopping client nodes (s). + static_clients - the number of permanently employed clients. + temp_client - number of clients who come log in and out. """ CACHE_NAME = "simple-tx-cache" PACING = 10 JAVA_CLIENT_CLASS_NAME = "org.apache.ignite.internal.ducktest.tests.start_stop_client.IgniteCachePutClient" - CLIENTS_WORK_TIME_S = 30 - ITERATION_COUNT = 3 - CLUSTER_NODES = 7 - STATIC_CLIENTS_NUM = 2 - TEMP_CLIENTS_NUM = 3 + @ignite_versions(str(V_2_8_1), str(DEV_BRANCH)) + @parametrize(cluster=7, + static_clients=2, + temp_client=3, + iteration_count=1, + client_work_time=30) + # pylint: disable=R0913 + def test_ignite_start_stop_nodes(self, ignite_version, + cluster, static_clients, temp_client, iteration_count, client_work_time): + """ + Start and stop clients node test without kill java process. + Check topology. + """ + self.ignite_start_stop(ignite_version, False, cluster, static_clients, + temp_client, iteration_count, client_work_time) + + @ignite_versions(str(V_2_8_1), str(DEV_BRANCH)) + @parametrize(cluster=7, + static_clients=2, + temp_client=3, + iteration_count=1, + client_work_time=30) + # pylint: disable=R0913 + def test_ignite_kill_start_nodes(self, ignite_version, + cluster, static_clients, temp_client, iteration_count, client_work_time): + """ + Start and kill client nodes, Check topology + """ + self.ignite_start_stop(ignite_version, True, cluster, static_clients, + temp_client, iteration_count, client_work_time) - @cluster(num_nodes=CLUSTER_NODES) - @ignite_versions(str(DEV_BRANCH), str(V_2_8_1)) - def test_ignite_start_stop(self, ignite_version): + # pylint: disable=R0914 + # pylint: disable=R0913 + def ignite_start_stop(self, ignite_version, kill_temp_nodes, + cluster, static_clients_num, temp_client, iteration_count, client_work_time): """ Test for starting and stopping fat clients. """ - servers_count = self.CLUSTER_NODES - self.STATIC_CLIENTS_NUM - self.TEMP_CLIENTS_NUM + servers_count = cluster - static_clients_num - temp_client - # Topology version after test. current_top_v = servers_count - fin_top_ver = servers_count + (2 * self.STATIC_CLIENTS_NUM) + (2 * self.ITERATION_COUNT * self.TEMP_CLIENTS_NUM) + # Topology version after test. + fin_top_ver = servers_count + (2 * static_clients_num) + (2 * iteration_count * temp_client) server_cfg = IgniteConfiguration( version=IgniteVersion(ignite_version), caches=[CacheConfiguration(name=self.CACHE_NAME, backups=1, atomicity_mode='TRANSACTIONAL')] ) + ignite = IgniteService(self.test_context, server_cfg, num_nodes=servers_count) control_utility = ControlUtility(ignite, self.test_context) @@ -78,7 +105,7 @@ def test_ignite_start_stop(self, ignite_version): self.test_context, client_cfg, java_class_name=self.JAVA_CLIENT_CLASS_NAME, - num_nodes=self.STATIC_CLIENTS_NUM, + num_nodes=static_clients_num, params={"cacheName": self.CACHE_NAME, "pacing": self.PACING}) @@ -86,7 +113,7 @@ def test_ignite_start_stop(self, ignite_version): self.test_context, client_cfg, java_class_name=self.JAVA_CLIENT_CLASS_NAME, - num_nodes=self.TEMP_CLIENTS_NUM, + num_nodes=temp_client, params={"cacheName": self.CACHE_NAME, "pacing": self.PACING}) @@ -94,36 +121,50 @@ def test_ignite_start_stop(self, ignite_version): static_clients.start() - current_top_v += self.STATIC_CLIENTS_NUM + current_top_v += static_clients_num check_topology(control_utility, current_top_v) # Start / stop temp_clients node. Check cluster. - for i in range(self.ITERATION_COUNT): + for i in range(iteration_count): self.logger.debug(f'Starting iteration: {i}.') - time.sleep(self.CLIENTS_WORK_TIME_S) - temp_clients.start() + current_top_v += temp_client - temp_clients.await_event(f'clients={self.STATIC_CLIENTS_NUM + self.TEMP_CLIENTS_NUM}', + static_clients.await_event(f'ver={current_top_v}, locNode=', timeout_sec=80, + from_the_beginning=True, backoff_sec=1) + check_topology(control_utility, current_top_v) + + temp_clients.await_event(f'clients={static_clients_num + temp_client}', timeout_sec=80, from_the_beginning=True, backoff_sec=1) - current_top_v += self.TEMP_CLIENTS_NUM - check_topology(control_utility, current_top_v) + time.sleep(client_work_time) + stop_service_nodes(temp_clients, kill_temp_nodes) - time.sleep(self.CLIENTS_WORK_TIME_S) - temp_clients.stop() - - current_top_v += self.TEMP_CLIENTS_NUM - check_topology(control_utility, current_top_v) + current_top_v += temp_client + static_clients.await_event(f'ver={current_top_v}, locNode=', timeout_sec=80, + from_the_beginning=True, backoff_sec=0.1) static_clients.stop() check_topology(control_utility, fin_top_ver) +def stop_service_nodes(service: IgniteApplicationService, kill_nodes): + """ + Base service stop command. + If kill_nodes=True kill node. + If kill_nodes=False then the node is shutting down correctly + """ + if kill_nodes: + for node in service.nodes: + service.stop_node(node=node, clean_shutdown=False) + else: + service.stop(clean_shutdown=True) + + def check_topology(control_utility: ControlUtility, fin_top_ver: int): """ Check current topology version. From bffa05f8c1fbbb869b9c861844bac782e2fdcc57 Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Mon, 19 Oct 2020 20:21:15 +0300 Subject: [PATCH 11/20] fix --- modules/ducktests/tests/ignitetest/tests/client_in_out_test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py index fb201e367a49a..adbf6d525f46b 100644 --- a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py +++ b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py @@ -35,7 +35,6 @@ class ClientTest(IgniteTest): CACHE_NAME - name of the cache to create for the test. PACING - the frequency of the operation on clients (ms). JAVA_CLIENT_CLASS_NAME - running classname. - client_work_time - clients working time (s). iteration_count - the number of iterations of starting and stopping client nodes (s). static_clients - the number of permanently employed clients. From 333fa8211040a2212389ab3a2f9824466ddb4da3 Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Mon, 19 Oct 2020 20:23:50 +0300 Subject: [PATCH 12/20] rm Project_Default.xml --- .idea/inspectionProfiles/Project_Default.xml | 771 ------------------- 1 file changed, 771 deletions(-) delete mode 100644 .idea/inspectionProfiles/Project_Default.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index d551eaf29f07a..0000000000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,771 +0,0 @@ - - - - \ No newline at end of file From 12b3a211ee8d056249c4f810d8ebeaff2b5bdccc Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Tue, 20 Oct 2020 11:34:39 +0300 Subject: [PATCH 13/20] iteration count --- .../ducktests/tests/ignitetest/tests/client_in_out_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py index adbf6d525f46b..d9bc79b571afb 100644 --- a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py +++ b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py @@ -49,7 +49,7 @@ class ClientTest(IgniteTest): @parametrize(cluster=7, static_clients=2, temp_client=3, - iteration_count=1, + iteration_count=3, client_work_time=30) # pylint: disable=R0913 def test_ignite_start_stop_nodes(self, ignite_version, @@ -65,7 +65,7 @@ def test_ignite_start_stop_nodes(self, ignite_version, @parametrize(cluster=7, static_clients=2, temp_client=3, - iteration_count=1, + iteration_count=3, client_work_time=30) # pylint: disable=R0913 def test_ignite_kill_start_nodes(self, ignite_version, From 8c2d350a7a35ed511e5698808c7652eb03f3ca48 Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Wed, 21 Oct 2020 15:17:10 +0300 Subject: [PATCH 14/20] fix check result, fix await finish event for clear_shutdown=False --- .../tests/ignitetest/services/ignite_app.py | 9 +++-- .../ignitetest/tests/client_in_out_test.py | 36 ++++++++----------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/modules/ducktests/tests/ignitetest/services/ignite_app.py b/modules/ducktests/tests/ignitetest/services/ignite_app.py index afbedd0557b3b..df2e1ecc15b4b 100644 --- a/modules/ducktests/tests/ignitetest/services/ignite_app.py +++ b/modules/ducktests/tests/ignitetest/services/ignite_app.py @@ -85,8 +85,11 @@ def stop(self, clean_shutdown=True, timeout_sec=10): """ Stop services. """ - self.stop_async(clean_shutdown) - self.await_stopped(timeout_sec) + if clean_shutdown: + self.stop_async(clean_shutdown) + self.await_stopped(timeout_sec) + else: + self.stop_async(clean_shutdown) def __check_status(self, desired, timeout=1): self.await_event("%s\\|IGNITE_APPLICATION_BROKEN" % desired, timeout, from_the_beginning=True) @@ -121,7 +124,7 @@ def extract_result(self, name): """ results = self.extract_results(name) - assert len(results) <= len(self.nodes), f"Expected exactly {len(self.nodes)} occurence," \ + assert len(results) != len(self.nodes), f"Expected exactly {len(self.nodes)} occurence," \ f" but found {len(results)}." return results[0] if results else "" diff --git a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py index d9bc79b571afb..6e17a3bfcc2e0 100644 --- a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py +++ b/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py @@ -17,6 +17,9 @@ This module contains client tests """ import time + +from ducktape.mark.resource import cluster + from ducktape.mark import parametrize from ignitetest.services.ignite import IgniteService from ignitetest.services.ignite_app import IgniteApplicationService @@ -46,45 +49,47 @@ class ClientTest(IgniteTest): JAVA_CLIENT_CLASS_NAME = "org.apache.ignite.internal.ducktest.tests.start_stop_client.IgniteCachePutClient" @ignite_versions(str(V_2_8_1), str(DEV_BRANCH)) - @parametrize(cluster=7, + @cluster(num_nodes=7) + @parametrize(num_nodes=7, static_clients=2, temp_client=3, iteration_count=3, client_work_time=30) # pylint: disable=R0913 def test_ignite_start_stop_nodes(self, ignite_version, - cluster, static_clients, temp_client, iteration_count, client_work_time): + num_nodes, static_clients, temp_client, iteration_count, client_work_time): """ Start and stop clients node test without kill java process. Check topology. """ - self.ignite_start_stop(ignite_version, False, cluster, static_clients, + self.ignite_start_stop(ignite_version, False, num_nodes, static_clients, temp_client, iteration_count, client_work_time) @ignite_versions(str(V_2_8_1), str(DEV_BRANCH)) - @parametrize(cluster=7, + @cluster(num_nodes=7) + @parametrize(num_nodes=7, static_clients=2, temp_client=3, iteration_count=3, client_work_time=30) # pylint: disable=R0913 def test_ignite_kill_start_nodes(self, ignite_version, - cluster, static_clients, temp_client, iteration_count, client_work_time): + num_nodes, static_clients, temp_client, iteration_count, client_work_time): """ Start and kill client nodes, Check topology """ - self.ignite_start_stop(ignite_version, True, cluster, static_clients, + self.ignite_start_stop(ignite_version, True, num_nodes, static_clients, temp_client, iteration_count, client_work_time) # pylint: disable=R0914 # pylint: disable=R0913 def ignite_start_stop(self, ignite_version, kill_temp_nodes, - cluster, static_clients_num, temp_client, iteration_count, client_work_time): + nodes_num, static_clients_num, temp_client, iteration_count, client_work_time): """ Test for starting and stopping fat clients. """ - servers_count = cluster - static_clients_num - temp_client + servers_count = nodes_num - static_clients_num - temp_client current_top_v = servers_count # Topology version after test. @@ -140,7 +145,7 @@ def ignite_start_stop(self, ignite_version, kill_temp_nodes, backoff_sec=1) time.sleep(client_work_time) - stop_service_nodes(temp_clients, kill_temp_nodes) + temp_clients.stop(kill_temp_nodes) current_top_v += temp_client @@ -151,19 +156,6 @@ def ignite_start_stop(self, ignite_version, kill_temp_nodes, check_topology(control_utility, fin_top_ver) -def stop_service_nodes(service: IgniteApplicationService, kill_nodes): - """ - Base service stop command. - If kill_nodes=True kill node. - If kill_nodes=False then the node is shutting down correctly - """ - if kill_nodes: - for node in service.nodes: - service.stop_node(node=node, clean_shutdown=False) - else: - service.stop(clean_shutdown=True) - - def check_topology(control_utility: ControlUtility, fin_top_ver: int): """ Check current topology version. From d61203725bf4896e54bcab6b3707f6ffe25e527e Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Wed, 21 Oct 2020 15:51:50 +0300 Subject: [PATCH 15/20] fix check result --- modules/ducktests/tests/ignitetest/services/ignite_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ducktests/tests/ignitetest/services/ignite_app.py b/modules/ducktests/tests/ignitetest/services/ignite_app.py index df2e1ecc15b4b..fa5cc5d6820bc 100644 --- a/modules/ducktests/tests/ignitetest/services/ignite_app.py +++ b/modules/ducktests/tests/ignitetest/services/ignite_app.py @@ -124,7 +124,7 @@ def extract_result(self, name): """ results = self.extract_results(name) - assert len(results) != len(self.nodes), f"Expected exactly {len(self.nodes)} occurence," \ + assert len(results) == len(self.nodes), f"Expected exactly {len(self.nodes)} occurence," \ f" but found {len(results)}." return results[0] if results else "" From 2fa9999fe36c5e873269496cf76acab64af8bb79 Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Wed, 21 Oct 2020 22:27:03 +0300 Subject: [PATCH 16/20] revert Project_Default.xml --- .idea/inspectionProfiles/Project_Default.xml | 771 +++++++++++++++++++ 1 file changed, 771 insertions(+) create mode 100644 .idea/inspectionProfiles/Project_Default.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000000000..d551eaf29f07a --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,771 @@ + + + + \ No newline at end of file From 8528c0b55cfc1107632b7388def290eacbfd3d71 Mon Sep 17 00:00:00 2001 From: "mix-swir@yandex.ru" Date: Wed, 21 Oct 2020 22:32:40 +0300 Subject: [PATCH 17/20] revert Project_Default.xml from ignite-ducktape branch --- .idea/inspectionProfiles/Project_Default.xml | 1461 +++++++++--------- 1 file changed, 733 insertions(+), 728 deletions(-) diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index d551eaf29f07a..23515edc761bf 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -1,771 +1,776 @@ - - - \ No newline at end of file +