From 9a259c4c6371fcc0ba81738f0d90a4eb6452576d Mon Sep 17 00:00:00 2001 From: Anton Vinogradov Date: Mon, 2 Nov 2020 15:45:14 +0300 Subject: [PATCH 1/8] WIP --- .../self_test/TestKillableApplication.java | 39 +++++++++++++++++ .../TestSelfKillableApplication.java | 36 ++++++++++++++++ .../utils/IgniteAwareApplicationService.java | 8 ++++ modules/ducktests/tests/docker/run_tests.sh | 2 +- .../tests/ignitetest/tests/assertion_test.py | 42 ++++++++++++++++++- 5 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/self_test/TestKillableApplication.java create mode 100644 modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/self_test/TestSelfKillableApplication.java diff --git a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/self_test/TestKillableApplication.java b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/self_test/TestKillableApplication.java new file mode 100644 index 0000000000000..c9f4e6789df66 --- /dev/null +++ b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/self_test/TestKillableApplication.java @@ -0,0 +1,39 @@ +/* + * 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.self_test; + +import com.fasterxml.jackson.databind.JsonNode; +import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication; +import org.apache.ignite.internal.util.typedef.internal.U; + +/** + * + */ +public class TestKillableApplication extends IgniteAwareApplication { + /** {@inheritDoc} */ + @Override public void run(JsonNode jsonNode) throws Exception { + markInitialized(); + + while (!terminated()) + U.sleep(100); + + U.sleep(5000); + + markFinished(); + } +} diff --git a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/self_test/TestSelfKillableApplication.java b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/self_test/TestSelfKillableApplication.java new file mode 100644 index 0000000000000..f0e1f4d0a5b45 --- /dev/null +++ b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/self_test/TestSelfKillableApplication.java @@ -0,0 +1,36 @@ +/* + * 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.self_test; + +import com.fasterxml.jackson.databind.JsonNode; +import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication; +import org.apache.ignite.internal.util.typedef.internal.U; + +/** + * + */ +public class TestSelfKillableApplication extends IgniteAwareApplication { + /** {@inheritDoc} */ + @Override public void run(JsonNode jsonNode) throws Exception { + markInitialized(); + + U.sleep(5000); + + markFinished(); + } +} diff --git a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/utils/IgniteAwareApplicationService.java b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/utils/IgniteAwareApplicationService.java index 7e8518035470a..0301cab5a3882 100644 --- a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/utils/IgniteAwareApplicationService.java +++ b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/utils/IgniteAwareApplicationService.java @@ -71,6 +71,8 @@ public static void main(String[] args) throws Exception { app.ignite = ignite; app.start(jsonNode); + + log.info("Just an info. [interrupted=" + Thread.currentThread().isInterrupted() + "]"); } finally { log.info("Ignite instance closed. [interrupted=" + Thread.currentThread().isInterrupted() + "]"); @@ -78,5 +80,11 @@ public static void main(String[] args) throws Exception { } else app.start(jsonNode); + + for (int i = 0; i < 10000; i++) + System.out.println(" ##### "); + + for (int i = 0; i < 10000; i++) + log.info(" ... "); } } diff --git a/modules/ducktests/tests/docker/run_tests.sh b/modules/ducktests/tests/docker/run_tests.sh index 93a8b7c0290ce..0d74f52141d92 100755 --- a/modules/ducktests/tests/docker/run_tests.sh +++ b/modules/ducktests/tests/docker/run_tests.sh @@ -31,7 +31,7 @@ IMAGE_NAME="${IMAGE_NAME:-$default_image_name}" # DuckerTest parameters are specified with options to the script # Path to ducktests -TC_PATHS="./ignitetest/" +TC_PATHS="./ignitetest/tests/assertion_test.py" # Global parameters to pass to ducktape util with --global param GLOBALS="{}" # Ducktests parameters to pass to ducktape util with --parameters param diff --git a/modules/ducktests/tests/ignitetest/tests/assertion_test.py b/modules/ducktests/tests/ignitetest/tests/assertion_test.py index 5ab9c90cb1ffd..0608ff134ec38 100644 --- a/modules/ducktests/tests/ignitetest/tests/assertion_test.py +++ b/modules/ducktests/tests/ignitetest/tests/assertion_test.py @@ -19,9 +19,11 @@ from ducktape.mark.resource import cluster +from ignitetest.services.ignite import IgniteService from ignitetest.services.ignite_app import IgniteApplicationService from ignitetest.services.ignite_execution_exception import IgniteExecutionException -from ignitetest.services.utils.ignite_configuration import IgniteConfiguration +from ignitetest.services.utils.ignite_configuration import IgniteConfiguration, IgniteClientConfiguration +from ignitetest.services.utils.ignite_configuration.discovery import from_ignite_cluster from ignitetest.utils import ignite_versions from ignitetest.utils.ignite_test import IgniteTest from ignitetest.utils.version import DEV_BRANCH, IgniteVersion @@ -35,7 +37,7 @@ class SmokeSelfTest(IgniteTest): @cluster(num_nodes=1) @ignite_versions(str(DEV_BRANCH)) - def test_assertion_convertion(self, ignite_version): + def est_assertion_convertion(self, ignite_version): """ Test to make sure Java assertions are converted to python exceptions """ @@ -53,3 +55,39 @@ def test_assertion_convertion(self, ignite_version): else: app.stop() assert False + + @ignite_versions(str(DEV_BRANCH)) + def test_services_start_stop(self, ignite_version): + ignites = IgniteService(self.test_context, IgniteConfiguration(version=IgniteVersion(ignite_version)), + num_nodes=1) + + ignites.start() + + client = IgniteService(self.test_context, IgniteClientConfiguration(version=IgniteVersion(ignite_version)), + num_nodes=1) + + client.start() + + node1 = IgniteApplicationService( + self.test_context, + IgniteClientConfiguration(version=IgniteVersion(ignite_version), + discovery_spi=from_ignite_cluster(ignites)), + java_class_name="org.apache.ignite.internal.ducktest.tests.self_test.TestKillableApplication", + timeout_sec=180) + + node2 = IgniteApplicationService( + self.test_context, + IgniteClientConfiguration(version=IgniteVersion(ignite_version), + discovery_spi=from_ignite_cluster(ignites)), + java_class_name="org.apache.ignite.internal.ducktest.tests.self_test.TestSelfKillableApplication", + timeout_sec=180) + + node1.start() + + node2.run() + + node1.stop() # logs are broken + + client.stop() + + ignites.stop() From 1623a3c910b149564c5d23289a52a3731e24e871 Mon Sep 17 00:00:00 2001 From: Anton Vinogradov Date: Tue, 3 Nov 2020 13:42:29 +0300 Subject: [PATCH 2/8] WIP --- .../ducktest/utils/IgniteAwareApplication.java | 10 +++++----- .../tests/ignitetest/services/utils/ignite_spec.py | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/utils/IgniteAwareApplication.java b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/utils/IgniteAwareApplication.java index f75a5b6d600be..3d65ab54a98c5 100644 --- a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/utils/IgniteAwareApplication.java +++ b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/utils/IgniteAwareApplication.java @@ -28,6 +28,7 @@ import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; +import sun.misc.Signal; /** * @@ -73,7 +74,7 @@ public abstract class IgniteAwareApplication { * Default constructor. */ protected IgniteAwareApplication() { - Runtime.getRuntime().addShutdownHook(new Thread(() -> { + Signal.handle(new Signal("TERM"), signal -> { log.info("SIGTERM recorded."); if (!finished && !broken) @@ -100,11 +101,10 @@ protected IgniteAwareApplication() { } } - if (log.isDebugEnabled()) - log.debug("Graceful termination done."); - })); + log.info("Application finished. Waiting for graceful termination."); + }); - log.info("ShutdownHook registered."); + log.info("SIGTERM handler registered."); } /** diff --git a/modules/ducktests/tests/ignitetest/services/utils/ignite_spec.py b/modules/ducktests/tests/ignitetest/services/utils/ignite_spec.py index 5977d233b7e1b..ac664f34e2922 100644 --- a/modules/ducktests/tests/ignitetest/services/utils/ignite_spec.py +++ b/modules/ducktests/tests/ignitetest/services/utils/ignite_spec.py @@ -186,6 +186,7 @@ def __init__(self, context, modules, servicejava_class_name, java_class_name, pa self.jvm_opts.extend([ "-DIGNITE_SUCCESS_FILE=" + self.PERSISTENT_ROOT + "/success_file", + "-Dlog4j.configuration=file:" + self.LOG4J_CONFIG_FILE, "-Dlog4j.configDebug=true", "-DIGNITE_NO_SHUTDOWN_HOOK=true", # allows to perform operations on app termination. "-Xmx1G", From 37b851577ff5664b93306d6e09ee2c0a99c26d14 Mon Sep 17 00:00:00 2001 From: Anton Vinogradov Date: Tue, 3 Nov 2020 14:22:16 +0300 Subject: [PATCH 3/8] WIP --- .../IgniteCachePutClient.java | 4 ++-- .../ducktest/utils/IgniteAwareApplicationService.java | 8 -------- modules/ducktests/tests/docker/run_tests.sh | 2 +- .../tests/{client_in_out_test.py => client_test.py} | 11 ++++------- .../tests/{assertion_test.py => self_test.py} | 8 ++++---- .../tests/ignitetest/tests/suites/fast_suite.yml | 2 +- 6 files changed, 12 insertions(+), 23 deletions(-) rename modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/{start_stop_client => client_test}/IgniteCachePutClient.java (95%) rename modules/ducktests/tests/ignitetest/tests/{client_in_out_test.py => client_test.py} (97%) rename modules/ducktests/tests/ignitetest/tests/{assertion_test.py => self_test.py} (94%) diff --git a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/IgniteCachePutClient.java b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/client_test/IgniteCachePutClient.java similarity index 95% rename from modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/IgniteCachePutClient.java rename to modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/client_test/IgniteCachePutClient.java index b0ecd63d8c881..0a337ce2a28e0 100644 --- a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/start_stop_client/IgniteCachePutClient.java +++ b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/client_test/IgniteCachePutClient.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.ignite.internal.ducktest.tests.start_stop_client; +package org.apache.ignite.internal.ducktest.tests.client_test; import java.util.Optional; import java.util.UUID; @@ -33,7 +33,7 @@ public class IgniteCachePutClient extends IgniteAwareApplication { long pacing = Optional.ofNullable(jsonNode.get("pacing")) .map(JsonNode::asLong) - .orElse(0l); + .orElse(0L); log.info("Test props:" + " cacheName=" + cacheName + diff --git a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/utils/IgniteAwareApplicationService.java b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/utils/IgniteAwareApplicationService.java index 0301cab5a3882..7e8518035470a 100644 --- a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/utils/IgniteAwareApplicationService.java +++ b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/utils/IgniteAwareApplicationService.java @@ -71,8 +71,6 @@ public static void main(String[] args) throws Exception { app.ignite = ignite; app.start(jsonNode); - - log.info("Just an info. [interrupted=" + Thread.currentThread().isInterrupted() + "]"); } finally { log.info("Ignite instance closed. [interrupted=" + Thread.currentThread().isInterrupted() + "]"); @@ -80,11 +78,5 @@ public static void main(String[] args) throws Exception { } else app.start(jsonNode); - - for (int i = 0; i < 10000; i++) - System.out.println(" ##### "); - - for (int i = 0; i < 10000; i++) - log.info(" ... "); } } diff --git a/modules/ducktests/tests/docker/run_tests.sh b/modules/ducktests/tests/docker/run_tests.sh index 0d74f52141d92..93a8b7c0290ce 100755 --- a/modules/ducktests/tests/docker/run_tests.sh +++ b/modules/ducktests/tests/docker/run_tests.sh @@ -31,7 +31,7 @@ IMAGE_NAME="${IMAGE_NAME:-$default_image_name}" # DuckerTest parameters are specified with options to the script # Path to ducktests -TC_PATHS="./ignitetest/tests/assertion_test.py" +TC_PATHS="./ignitetest/" # Global parameters to pass to ducktape util with --global param GLOBALS="{}" # Ducktests parameters to pass to ducktape util with --parameters param diff --git a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py b/modules/ducktests/tests/ignitetest/tests/client_test.py similarity index 97% rename from modules/ducktests/tests/ignitetest/tests/client_in_out_test.py rename to modules/ducktests/tests/ignitetest/tests/client_test.py index aab699a9ef579..f212ed5e1abd6 100644 --- a/modules/ducktests/tests/ignitetest/tests/client_in_out_test.py +++ b/modules/ducktests/tests/ignitetest/tests/client_test.py @@ -18,14 +18,14 @@ """ import time +from ducktape.mark import parametrize 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 -from ignitetest.services.utils.ignite_configuration.cache import CacheConfiguration from ignitetest.services.utils.ignite_configuration import IgniteConfiguration +from ignitetest.services.utils.ignite_configuration.cache import CacheConfiguration 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 @@ -46,7 +46,7 @@ class ClientTest(IgniteTest): CACHE_NAME = "simple-tx-cache" PACING = 10 - JAVA_CLIENT_CLASS_NAME = "org.apache.ignite.internal.ducktest.tests.start_stop_client.IgniteCachePutClient" + JAVA_CLIENT_CLASS_NAME = "org.apache.ignite.internal.ducktest.tests.client_test.IgniteCachePutClient" @ignite_versions(str(V_2_8_1), str(DEV_BRANCH)) @cluster(num_nodes=7) @@ -55,7 +55,6 @@ class ClientTest(IgniteTest): temp_client=3, iteration_count=3, client_work_time=30) - # pylint: disable=R0913 def test_ignite_start_stop_nodes(self, ignite_version, num_nodes, static_clients, temp_client, iteration_count, client_work_time): """ @@ -72,7 +71,6 @@ def test_ignite_start_stop_nodes(self, ignite_version, temp_client=3, iteration_count=3, client_work_time=30) - # pylint: disable=R0913 def test_ignite_kill_start_nodes(self, ignite_version, num_nodes, static_clients, temp_client, iteration_count, client_work_time): """ @@ -81,8 +79,6 @@ def test_ignite_kill_start_nodes(self, ignite_version, self.ignite_start_stop(ignite_version, False, num_nodes, static_clients, temp_client, iteration_count, client_work_time) - # pylint: disable=R0914 - # pylint: disable=R0913 def ignite_start_stop(self, ignite_version, correct_stop_temp_node, nodes_num, static_clients_num, temp_client, iteration_count, client_work_time): """ @@ -92,6 +88,7 @@ def ignite_start_stop(self, ignite_version, correct_stop_temp_node, servers_count = nodes_num - static_clients_num - temp_client current_top_v = servers_count + # Topology version after test. fin_top_ver = servers_count + (2 * static_clients_num) + (2 * iteration_count * temp_client) diff --git a/modules/ducktests/tests/ignitetest/tests/assertion_test.py b/modules/ducktests/tests/ignitetest/tests/self_test.py similarity index 94% rename from modules/ducktests/tests/ignitetest/tests/assertion_test.py rename to modules/ducktests/tests/ignitetest/tests/self_test.py index 0608ff134ec38..906834a90e5ad 100644 --- a/modules/ducktests/tests/ignitetest/tests/assertion_test.py +++ b/modules/ducktests/tests/ignitetest/tests/self_test.py @@ -30,14 +30,14 @@ # pylint: disable=W0223 -class SmokeSelfTest(IgniteTest): +class SelfTest(IgniteTest): """ Self test """ @cluster(num_nodes=1) @ignite_versions(str(DEV_BRANCH)) - def est_assertion_convertion(self, ignite_version): + def test_assertion_convertion(self, ignite_version): """ Test to make sure Java assertions are converted to python exceptions """ @@ -57,7 +57,7 @@ def est_assertion_convertion(self, ignite_version): assert False @ignite_versions(str(DEV_BRANCH)) - def test_services_start_stop(self, ignite_version): + def test_simple_services_start_stop(self, ignite_version): ignites = IgniteService(self.test_context, IgniteConfiguration(version=IgniteVersion(ignite_version)), num_nodes=1) @@ -86,7 +86,7 @@ def test_services_start_stop(self, ignite_version): node2.run() - node1.stop() # logs are broken + node1.stop() client.stop() diff --git a/modules/ducktests/tests/ignitetest/tests/suites/fast_suite.yml b/modules/ducktests/tests/ignitetest/tests/suites/fast_suite.yml index 714a9af43e840..7725391963539 100644 --- a/modules/ducktests/tests/ignitetest/tests/suites/fast_suite.yml +++ b/modules/ducktests/tests/ignitetest/tests/suites/fast_suite.yml @@ -29,5 +29,5 @@ rebalance: - ../add_node_rebalance_test.py clients: - - ../client_in_out_test.py + - ../client_test.py From 8b4229f4cb90677bbaaf3b58a421f1e05881a9f4 Mon Sep 17 00:00:00 2001 From: Anton Vinogradov Date: Tue, 3 Nov 2020 14:28:06 +0300 Subject: [PATCH 4/8] WIP --- .../tests/ignitetest/tests/client_test.py | 60 ++++++++----------- 1 file changed, 24 insertions(+), 36 deletions(-) diff --git a/modules/ducktests/tests/ignitetest/tests/client_test.py b/modules/ducktests/tests/ignitetest/tests/client_test.py index f212ed5e1abd6..64ec7bb6514fc 100644 --- a/modules/ducktests/tests/ignitetest/tests/client_test.py +++ b/modules/ducktests/tests/ignitetest/tests/client_test.py @@ -50,13 +50,9 @@ class ClientTest(IgniteTest): @ignite_versions(str(V_2_8_1), str(DEV_BRANCH)) @cluster(num_nodes=7) - @parametrize(num_nodes=7, - static_clients=2, - temp_client=3, - iteration_count=3, - client_work_time=30) - def test_ignite_start_stop_nodes(self, ignite_version, - num_nodes, static_clients, temp_client, iteration_count, client_work_time): + @parametrize(num_nodes=7, static_clients=2, temp_client=3, iteration_count=3, client_work_time=30) + def test_ignite_start_stop_nodes(self, ignite_version, num_nodes, static_clients, temp_client, iteration_count, + client_work_time): """ Start and stop clients node test without kill java process. Check topology. @@ -66,63 +62,51 @@ def test_ignite_start_stop_nodes(self, ignite_version, @ignite_versions(str(V_2_8_1), str(DEV_BRANCH)) @cluster(num_nodes=7) - @parametrize(num_nodes=7, - static_clients=2, - temp_client=3, - iteration_count=3, - client_work_time=30) - def test_ignite_kill_start_nodes(self, ignite_version, - num_nodes, static_clients, temp_client, iteration_count, client_work_time): + @parametrize(num_nodes=7, static_clients=2, temp_client=3, iteration_count=3, client_work_time=30) + def test_ignite_kill_start_nodes(self, ignite_version, num_nodes, static_clients, temp_client, iteration_count, + client_work_time): """ Start and kill client nodes, Check topology """ self.ignite_start_stop(ignite_version, False, num_nodes, static_clients, temp_client, iteration_count, client_work_time) - def ignite_start_stop(self, ignite_version, correct_stop_temp_node, - nodes_num, static_clients_num, temp_client, iteration_count, client_work_time): + def ignite_start_stop(self, ignite_version, correct_stop_temp_node, nodes_num, static_clients_num, temp_client, + iteration_count, client_work_time): """ Test for starting and stopping fat clients. """ servers_count = nodes_num - static_clients_num - temp_client - current_top_v = servers_count # 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')] - ) + 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) - static_clients = IgniteApplicationService( - self.test_context, - client_cfg, - java_class_name=self.JAVA_CLIENT_CLASS_NAME, - num_nodes=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=temp_client, - params={"cacheName": self.CACHE_NAME, - "pacing": self.PACING}) + static_clients = IgniteApplicationService(self.test_context, client_cfg, + java_class_name=self.JAVA_CLIENT_CLASS_NAME, + num_nodes=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=temp_client, + params={"cacheName": self.CACHE_NAME, "pacing": self.PACING}) ignite.start() static_clients.start() current_top_v += static_clients_num + check_topology(control_utility, current_top_v) # Start / stop temp_clients node. Check cluster. @@ -130,19 +114,23 @@ def ignite_start_stop(self, ignite_version, correct_stop_temp_node, self.logger.debug(f'Starting iteration: {i}.') temp_clients.start() + current_top_v += temp_client await_event(static_clients, f'ver={current_top_v}, locNode=') + check_topology(control_utility, current_top_v) await_event(temp_clients, f'clients={static_clients_num + temp_client}') time.sleep(client_work_time) + temp_clients.stop(correct_stop_temp_node) current_top_v += temp_client await_event(static_clients, f'ver={current_top_v}, locNode=') + static_clients.stop() check_topology(control_utility, fin_top_ver) From 2f5c731f7f36926924f0e4af6aa7272b888831b3 Mon Sep 17 00:00:00 2001 From: Anton Vinogradov Date: Tue, 3 Nov 2020 14:29:35 +0300 Subject: [PATCH 5/8] WIP --- modules/ducktests/tests/ignitetest/tests/self_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/ducktests/tests/ignitetest/tests/self_test.py b/modules/ducktests/tests/ignitetest/tests/self_test.py index 906834a90e5ad..dd4776eec4cae 100644 --- a/modules/ducktests/tests/ignitetest/tests/self_test.py +++ b/modules/ducktests/tests/ignitetest/tests/self_test.py @@ -56,6 +56,7 @@ def test_assertion_convertion(self, ignite_version): app.stop() assert False + @cluster(num_nodes=4) @ignite_versions(str(DEV_BRANCH)) def test_simple_services_start_stop(self, ignite_version): ignites = IgniteService(self.test_context, IgniteConfiguration(version=IgniteVersion(ignite_version)), From 8fe42b3a47ae0d29e504273f52373e409d091eb0 Mon Sep 17 00:00:00 2001 From: Anton Vinogradov Date: Tue, 3 Nov 2020 14:37:13 +0300 Subject: [PATCH 6/8] WIP --- modules/ducktests/tests/ignitetest/tests/client_test.py | 4 ++++ modules/ducktests/tests/ignitetest/tests/self_test.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/modules/ducktests/tests/ignitetest/tests/client_test.py b/modules/ducktests/tests/ignitetest/tests/client_test.py index 64ec7bb6514fc..fc3186273c204 100644 --- a/modules/ducktests/tests/ignitetest/tests/client_test.py +++ b/modules/ducktests/tests/ignitetest/tests/client_test.py @@ -48,6 +48,7 @@ class ClientTest(IgniteTest): PACING = 10 JAVA_CLIENT_CLASS_NAME = "org.apache.ignite.internal.ducktest.tests.client_test.IgniteCachePutClient" + # pylint: disable=R0913 @ignite_versions(str(V_2_8_1), str(DEV_BRANCH)) @cluster(num_nodes=7) @parametrize(num_nodes=7, static_clients=2, temp_client=3, iteration_count=3, client_work_time=30) @@ -60,6 +61,7 @@ def test_ignite_start_stop_nodes(self, ignite_version, num_nodes, static_clients self.ignite_start_stop(ignite_version, True, num_nodes, static_clients, temp_client, iteration_count, client_work_time) + # pylint: disable=R0913 @ignite_versions(str(V_2_8_1), str(DEV_BRANCH)) @cluster(num_nodes=7) @parametrize(num_nodes=7, static_clients=2, temp_client=3, iteration_count=3, client_work_time=30) @@ -71,6 +73,8 @@ def test_ignite_kill_start_nodes(self, ignite_version, num_nodes, static_clients self.ignite_start_stop(ignite_version, False, num_nodes, static_clients, temp_client, iteration_count, client_work_time) + # pylint: disable=R0913 + # pylint: disable=R0914 def ignite_start_stop(self, ignite_version, correct_stop_temp_node, nodes_num, static_clients_num, temp_client, iteration_count, client_work_time): """ diff --git a/modules/ducktests/tests/ignitetest/tests/self_test.py b/modules/ducktests/tests/ignitetest/tests/self_test.py index dd4776eec4cae..6d1a15911653d 100644 --- a/modules/ducktests/tests/ignitetest/tests/self_test.py +++ b/modules/ducktests/tests/ignitetest/tests/self_test.py @@ -59,6 +59,9 @@ def test_assertion_convertion(self, ignite_version): @cluster(num_nodes=4) @ignite_versions(str(DEV_BRANCH)) def test_simple_services_start_stop(self, ignite_version): + """ + Tests plain services start and stop (termitation vs self-terination). + """ ignites = IgniteService(self.test_context, IgniteConfiguration(version=IgniteVersion(ignite_version)), num_nodes=1) From 8cf36d1c6873f9dfdc15e890a837309539a6b669 Mon Sep 17 00:00:00 2001 From: Anton Vinogradov Date: Tue, 3 Nov 2020 14:38:28 +0300 Subject: [PATCH 7/8] WIP --- modules/ducktests/tests/ignitetest/tests/client_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ducktests/tests/ignitetest/tests/client_test.py b/modules/ducktests/tests/ignitetest/tests/client_test.py index fc3186273c204..5a5d2f83a9629 100644 --- a/modules/ducktests/tests/ignitetest/tests/client_test.py +++ b/modules/ducktests/tests/ignitetest/tests/client_test.py @@ -73,8 +73,8 @@ def test_ignite_kill_start_nodes(self, ignite_version, num_nodes, static_clients self.ignite_start_stop(ignite_version, False, num_nodes, static_clients, temp_client, iteration_count, client_work_time) - # pylint: disable=R0913 # pylint: disable=R0914 + # pylint: disable=R0913 def ignite_start_stop(self, ignite_version, correct_stop_temp_node, nodes_num, static_clients_num, temp_client, iteration_count, client_work_time): """ From 9d99392dd03b6a0707b5ca57a0108f8c5e77ac6f Mon Sep 17 00:00:00 2001 From: Anton Vinogradov Date: Tue, 3 Nov 2020 15:05:40 +0300 Subject: [PATCH 8/8] WIP --- modules/ducktests/tests/ignitetest/tests/client_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ducktests/tests/ignitetest/tests/client_test.py b/modules/ducktests/tests/ignitetest/tests/client_test.py index 5a5d2f83a9629..8f5c84a657d24 100644 --- a/modules/ducktests/tests/ignitetest/tests/client_test.py +++ b/modules/ducktests/tests/ignitetest/tests/client_test.py @@ -115,7 +115,7 @@ def ignite_start_stop(self, ignite_version, correct_stop_temp_node, nodes_num, s # Start / stop temp_clients node. Check cluster. for i in range(iteration_count): - self.logger.debug(f'Starting iteration: {i}.') + self.logger.info(f'Starting iteration: {i}.') temp_clients.start()