You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/10/09 09:34:57 UTC

[GitHub] [ignite] anton-vinogradov commented on a change in pull request #8341: IGN-1794

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



##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/CreateDestroyCache.java
##########
@@ -0,0 +1,29 @@
+package org.apache.ignite.internal.ducktest.tests;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteDataStreamer;
+import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication;
+
+/**
+ * https://sbtatlas.sigma.sbrf.ru/jira/browse/IGN-1794
+ * create and destroy a cache with specific name to check for memory leak
+ */
+public class CreateDestroyCache extends IgniteAwareApplication {
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void run(JsonNode jsonNode) {
+        for (int i = 0; i < jsonNode.get("caches_number").asInt(); i++) {
+            log.info("Creating cache" + i + "...");
+            IgniteCache<Integer, Integer> cache = ignite.createCache(jsonNode.get("cacheName").asText());
+
+            log.info("Destroying cache...");
+            ignite.destroyCache(jsonNode.get("cacheName").asText());
+
+        }
+        markFinished();

Review comment:
       newline missed here

##########
File path: modules/ducktests/tests/ignitetest/tests/cache_destroy.py
##########
@@ -0,0 +1,58 @@
+# 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 cache create/destroy tests that checks if
+"""
+
+from ducktape.mark.resource import cluster
+
+from ignitetest.services.ignite_app import IgniteApplicationService
+from ignitetest.services.ignite_execution_exception import IgniteExecutionException
+from ignitetest.services.ignite import IgniteService
+from ignitetest.services.ignite_app import IgniteApplicationService
+from ignitetest.services.spark import SparkService
+from ignitetest.services.utils.ignite_configuration.discovery import from_ignite_cluster
+from ignitetest.services.utils.ignite_configuration import IgniteConfiguration
+from ignitetest.services.zk.zookeeper import ZookeeperService
+from ignitetest.utils import ignite_versions
+from ignitetest.utils.ignite_test import IgniteTest
+from ignitetest.utils.version import DEV_BRANCH, IgniteVersion
+
+# pylint: disable=W0223
+class CacheDestroyTest(IgniteTest):
+    """
+    https://sbtatlas.sigma.sbrf.ru/jira/browse/IGN-1794
+
+    """
+    NUM_NODES = 1
+    CACHE_NAME = "TEST01"

Review comment:
       odd cache name

##########
File path: modules/ducktests/tests/ignitetest/tests/cache_destroy.py
##########
@@ -0,0 +1,58 @@
+# 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 cache create/destroy tests that checks if
+"""
+
+from ducktape.mark.resource import cluster
+
+from ignitetest.services.ignite_app import IgniteApplicationService
+from ignitetest.services.ignite_execution_exception import IgniteExecutionException
+from ignitetest.services.ignite import IgniteService
+from ignitetest.services.ignite_app import IgniteApplicationService
+from ignitetest.services.spark import SparkService
+from ignitetest.services.utils.ignite_configuration.discovery import from_ignite_cluster
+from ignitetest.services.utils.ignite_configuration import IgniteConfiguration
+from ignitetest.services.zk.zookeeper import ZookeeperService
+from ignitetest.utils import ignite_versions
+from ignitetest.utils.ignite_test import IgniteTest
+from ignitetest.utils.version import DEV_BRANCH, IgniteVersion
+
+# pylint: disable=W0223
+class CacheDestroyTest(IgniteTest):
+    """
+    https://sbtatlas.sigma.sbrf.ru/jira/browse/IGN-1794
+
+    """
+    NUM_NODES = 1
+    CACHE_NAME = "TEST01"
+    CACHES_AMOUNT = 10
+
+    @cluster(num_nodes=NUM_NODES+1)
+    @ignite_versions(str(DEV_BRANCH), str(LATEST_2_8))
+    def test(self, ignite_version):
+
+        node_config = IgniteConfiguration(version=IgniteVersion(ignite_version))
+
+        ignites = IgniteService(self.test_context, config=node_config, num_nodes=self.NUM_NODES)
+        ignites.start()
+
+        # This client just put some data to the cache.
+        app_config = node_config._replace(client_mode=True, discovery_spi=from_ignite_cluster(ignites))
+        IgniteApplicationService(self.test_context, config=app_config,
+                                 java_class_name="org.apache.ignite.internal.ducktest.tests.CreateDestroyCache",
+                                 params={"cacheName": self.CACHE_NAME, "caches_number": self.CACHES_AMOUNT}).run()

Review comment:
       please use single style at params naming

##########
File path: modules/ducktests/tests/ignitetest/tests/cache_destroy.py
##########
@@ -0,0 +1,58 @@
+# 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 cache create/destroy tests that checks if
+"""
+
+from ducktape.mark.resource import cluster
+
+from ignitetest.services.ignite_app import IgniteApplicationService
+from ignitetest.services.ignite_execution_exception import IgniteExecutionException
+from ignitetest.services.ignite import IgniteService
+from ignitetest.services.ignite_app import IgniteApplicationService
+from ignitetest.services.spark import SparkService
+from ignitetest.services.utils.ignite_configuration.discovery import from_ignite_cluster
+from ignitetest.services.utils.ignite_configuration import IgniteConfiguration
+from ignitetest.services.zk.zookeeper import ZookeeperService
+from ignitetest.utils import ignite_versions
+from ignitetest.utils.ignite_test import IgniteTest
+from ignitetest.utils.version import DEV_BRANCH, IgniteVersion
+
+# pylint: disable=W0223
+class CacheDestroyTest(IgniteTest):
+    """
+    https://sbtatlas.sigma.sbrf.ru/jira/browse/IGN-1794

Review comment:
       private data should not be spread to opensource

##########
File path: modules/ducktests/tests/ignitetest/tests/cache_destroy.py
##########
@@ -0,0 +1,58 @@
+# 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 cache create/destroy tests that checks if
+"""
+
+from ducktape.mark.resource import cluster
+
+from ignitetest.services.ignite_app import IgniteApplicationService
+from ignitetest.services.ignite_execution_exception import IgniteExecutionException
+from ignitetest.services.ignite import IgniteService
+from ignitetest.services.ignite_app import IgniteApplicationService
+from ignitetest.services.spark import SparkService
+from ignitetest.services.utils.ignite_configuration.discovery import from_ignite_cluster
+from ignitetest.services.utils.ignite_configuration import IgniteConfiguration
+from ignitetest.services.zk.zookeeper import ZookeeperService
+from ignitetest.utils import ignite_versions
+from ignitetest.utils.ignite_test import IgniteTest
+from ignitetest.utils.version import DEV_BRANCH, IgniteVersion
+
+# pylint: disable=W0223
+class CacheDestroyTest(IgniteTest):
+    """
+    https://sbtatlas.sigma.sbrf.ru/jira/browse/IGN-1794
+
+    """
+    NUM_NODES = 1
+    CACHE_NAME = "TEST01"
+    CACHES_AMOUNT = 10
+
+    @cluster(num_nodes=NUM_NODES+1)
+    @ignite_versions(str(DEV_BRANCH), str(LATEST_2_8))
+    def test(self, ignite_version):
+

Review comment:
       seems method documentation missed.
   see Travis report for details (at PR conversation page)

##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/CreateDestroyCache.java
##########
@@ -0,0 +1,29 @@
+package org.apache.ignite.internal.ducktest.tests;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteDataStreamer;
+import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication;
+
+/**
+ * https://sbtatlas.sigma.sbrf.ru/jira/browse/IGN-1794
+ * create and destroy a cache with specific name to check for memory leak
+ */
+public class CreateDestroyCache extends IgniteAwareApplication {
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void run(JsonNode jsonNode) {
+        for (int i = 0; i < jsonNode.get("caches_number").asInt(); i++) {
+            log.info("Creating cache" + i + "...");
+            IgniteCache<Integer, Integer> cache = ignite.createCache(jsonNode.get("cacheName").asText());
+
+            log.info("Destroying cache...");
+            ignite.destroyCache(jsonNode.get("cacheName").asText());
+

Review comment:
       newline is not required here

##########
File path: modules/ducktests/tests/ignitetest/tests/cache_destroy.py
##########
@@ -0,0 +1,58 @@
+# 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 cache create/destroy tests that checks if
+"""
+
+from ducktape.mark.resource import cluster
+
+from ignitetest.services.ignite_app import IgniteApplicationService
+from ignitetest.services.ignite_execution_exception import IgniteExecutionException
+from ignitetest.services.ignite import IgniteService
+from ignitetest.services.ignite_app import IgniteApplicationService
+from ignitetest.services.spark import SparkService
+from ignitetest.services.utils.ignite_configuration.discovery import from_ignite_cluster
+from ignitetest.services.utils.ignite_configuration import IgniteConfiguration
+from ignitetest.services.zk.zookeeper import ZookeeperService
+from ignitetest.utils import ignite_versions
+from ignitetest.utils.ignite_test import IgniteTest
+from ignitetest.utils.version import DEV_BRANCH, IgniteVersion
+
+# pylint: disable=W0223
+class CacheDestroyTest(IgniteTest):
+    """
+    https://sbtatlas.sigma.sbrf.ru/jira/browse/IGN-1794
+
+    """
+    NUM_NODES = 1
+    CACHE_NAME = "TEST01"
+    CACHES_AMOUNT = 10
+
+    @cluster(num_nodes=NUM_NODES+1)
+    @ignite_versions(str(DEV_BRANCH), str(LATEST_2_8))
+    def test(self, ignite_version):
+
+        node_config = IgniteConfiguration(version=IgniteVersion(ignite_version))
+
+        ignites = IgniteService(self.test_context, config=node_config, num_nodes=self.NUM_NODES)
+        ignites.start()
+
+        # This client just put some data to the cache.

Review comment:
       is this a proper description?




----------------------------------------------------------------
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:
users@infra.apache.org