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 2021/07/23 11:52:29 UTC
[GitHub] [ignite] map7000 opened a new pull request #9274: IGNITE-15169 Client mass reconnection test
map7000 opened a new pull request #9274:
URL: https://github.com/apache/ignite/pull/9274
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
### The Contribution Checklist
- [ ] There is a single JIRA ticket related to the pull request.
- [ ] The web-link to the pull request is attached to the JIRA ticket.
- [ ] The JIRA ticket has the _Patch Available_ state.
- [ ] The pull request body describes changes that have been made.
The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
- [ ] The pull request title is treated as the final commit message.
The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
- [ ] A reviewer has been mentioned through the JIRA comments
(see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
- [ ] The pull request has been checked by the Teamcity Bot and
the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
### Notes
- [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
- [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
- [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
- [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] map7000 commented on a change in pull request #9274: IGNITE-15169 Client mass reconnection test
Posted by GitBox <gi...@apache.org>.
map7000 commented on a change in pull request #9274:
URL: https://github.com/apache/ignite/pull/9274#discussion_r735466913
##########
File path: modules/ducktests/tests/ignitetest/tests/thin_client_test.py
##########
@@ -60,3 +69,63 @@ def test_thin_client_compatibility(self, server_version, thin_client_version):
ignite.start()
thin_clients.run()
ignite.stop()
+
+ @cluster(num_nodes=4)
+ @ignite_versions(str(DEV_BRANCH))
+ @matrix(test_params=[{"connectClients": 150, "putClients": 0, "putAllClients": 0, "runTime": 60, "freeze": True},
+ {"connectClients": 150, "putClients": 0, "putAllClients": 0, "runTime": 60, "freeze": False},
+ {"connectClients": 150, "putClients": 2, "putAllClients": 0, "runTime": 60, "freeze": False},
+ {"connectClients": 150, "putClients": 0, "putAllClients": 2, "runTime": 60, "freeze": False}])
+ def test_thin_client_connect_time(self, ignite_version, test_params):
+ """
+ Thin client connect time test.
+ Determine how thin client connection time depend on cluster load
+ Demonstrate 4 situations:
+ - Cluster have too much clients
+ - Cluster have many put's
+ - Cluster have some putAll jobs
+ - One node hung for some time
+ """
+
+ server_config = \
+ IgniteConfiguration(version=IgniteVersion(ignite_version),
+ data_storage=DataStorageConfiguration(default=DataRegionConfiguration(persistent=True)),
+ client_connector_configuration=ClientConnectorConfiguration())
+
+ ignite = IgniteService(self.test_context, server_config, 2)
+
+ addresses = ignite.nodes[0].account.hostname + ":" + str(server_config.client_connector_configuration.port)
+
+ thin_clients = IgniteApplicationService(self.test_context,
+ IgniteThinClientConfiguration(addresses=addresses,
+ version=IgniteVersion(
+ ignite_version)),
+ java_class_name=self.JAVA_CLIENT_CLASS_NAME_CON,
+ params={"connectClients": test_params["connectClients"],
+ "putClients": test_params["putClients"],
+ "putAllClients": test_params["putAllClients"],
+ "runTime": test_params["runTime"]},
+ num_nodes=2,
+ startup_timeout_sec=60)
+
+ ignite.start()
+ ControlUtility(cluster=ignite).activate()
Review comment:
ControlUtility used only once. May be inline
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] map7000 commented on a change in pull request #9274: IGNITE-15169 Client mass reconnection test
Posted by GitBox <gi...@apache.org>.
map7000 commented on a change in pull request #9274:
URL: https://github.com/apache/ignite/pull/9274#discussion_r735465814
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusRunner.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.List;
+import java.util.UUID;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.configuration.ClientConfiguration;
+
+/** Start Thin Client making some operations for a given time. */
+public class ThinClientContiniusRunner implements Runnable {
+ /** Time of one iteration. */
+ private static final int RUN_TIME = 1000;
+
+ /** Ignite Client configuration. */
+ private ClientConfiguration cfg;
+
+ /** Time of connection. */
+ private List<Long> connectTime;
+
+ /** Type of client. */
+ private ContiniusClientInterface func;
+
+ /** {@inheritDoc} */
Review comment:
fix
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] map7000 commented on a change in pull request #9274: IGNITE-15169 Client mass reconnection test
Posted by GitBox <gi...@apache.org>.
map7000 commented on a change in pull request #9274:
URL: https://github.com/apache/ignite/pull/9274#discussion_r735465230
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusApplication.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.TimeUnit;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.configuration.ClientConfiguration;
+import org.apache.ignite.internal.IgnitionEx;
+import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication;
+
+/** */
+@FunctionalInterface
+interface ContiniusClientInterface {
+ /** */
+ public void apply(ClientCache<UUID, byte[]> cache, long stopTime) throws InterruptedException;
+}
+
+/** Run multiple Thin Clients making some work for a given time
+ * connectClients connect, wait, disconnect, repeat
+ * putClients - connect, put many times, disconnect, repeat
+ * putAllClients - connect, putAll, disconnnet, repeat
+ */
+public class ThinClientContiniusApplication extends IgniteAwareApplication {
+ /** Size of one entry. */
+ private static final int DATA_SIZE = 15;
+
+ /** Time of one iteration. */
+ private static final int RUN_TIME = 1000;
+
+ /** Size of Map to putAll. */
+ private static final int PUT_ALL_SIZE = 1000;
+
+ /** {@inheritDoc} */
+ @Override protected void run(JsonNode jsonNode) throws Exception {
+ int connectClients = jsonNode.get("connectClients").asInt();
+
+ int putClients = jsonNode.get("putClients").asInt();
+
+ int putAllClients = jsonNode.get("putAllClients").asInt();
+
+ int runTime = jsonNode.get("runTime").asInt();
+
+ client.close();
+
+ ContiniusClientInterface connectClientsImpl = (ClientCache<UUID, byte[]> cache, long stopTyme) -> {
Review comment:
fix
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusRunner.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.List;
+import java.util.UUID;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.configuration.ClientConfiguration;
+
+/** Start Thin Client making some operations for a given time. */
+public class ThinClientContiniusRunner implements Runnable {
+ /** Time of one iteration. */
+ private static final int RUN_TIME = 1000;
Review comment:
fix
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] map7000 commented on a change in pull request #9274: IGNITE-15169 Client mass reconnection test
Posted by GitBox <gi...@apache.org>.
map7000 commented on a change in pull request #9274:
URL: https://github.com/apache/ignite/pull/9274#discussion_r735467699
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusRunner.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.List;
+import java.util.UUID;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.configuration.ClientConfiguration;
+
+/** Start Thin Client making some operations for a given time. */
+public class ThinClientContiniusRunner implements Runnable {
+ /** Time of one iteration. */
+ private static final int RUN_TIME = 1000;
+
+ /** Ignite Client configuration. */
+ private ClientConfiguration cfg;
+
+ /** Time of connection. */
+ private List<Long> connectTime;
+
+ /** Type of client. */
+ private ContiniusClientInterface func;
+
+ /** {@inheritDoc} */
Review comment:
fix
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] map7000 commented on a change in pull request #9274: IGNITE-15169 Client mass reconnection test
Posted by GitBox <gi...@apache.org>.
map7000 commented on a change in pull request #9274:
URL: https://github.com/apache/ignite/pull/9274#discussion_r735465095
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusApplication.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.TimeUnit;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.configuration.ClientConfiguration;
+import org.apache.ignite.internal.IgnitionEx;
+import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication;
+
+/** */
+@FunctionalInterface
+interface ContiniusClientInterface {
+ /** */
Review comment:
fix
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] map7000 commented on a change in pull request #9274: IGNITE-15169 Client mass reconnection test
Posted by GitBox <gi...@apache.org>.
map7000 commented on a change in pull request #9274:
URL: https://github.com/apache/ignite/pull/9274#discussion_r735467096
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusRunner.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.List;
+import java.util.UUID;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.configuration.ClientConfiguration;
+
+/** Start Thin Client making some operations for a given time. */
+public class ThinClientContiniusRunner implements Runnable {
+ /** Time of one iteration. */
+ private static final int RUN_TIME = 1000;
+
+ /** Ignite Client configuration. */
+ private ClientConfiguration cfg;
Review comment:
fix
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] map7000 commented on a change in pull request #9274: IGNITE-15169 Client mass reconnection test
Posted by GitBox <gi...@apache.org>.
map7000 commented on a change in pull request #9274:
URL: https://github.com/apache/ignite/pull/9274#discussion_r735464981
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusApplication.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.TimeUnit;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.configuration.ClientConfiguration;
+import org.apache.ignite.internal.IgnitionEx;
+import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication;
+
+/** */
+@FunctionalInterface
+interface ContiniusClientInterface {
+ /** */
+ public void apply(ClientCache<UUID, byte[]> cache, long stopTime) throws InterruptedException;
+}
+
+/** Run multiple Thin Clients making some work for a given time
+ * connectClients connect, wait, disconnect, repeat
+ * putClients - connect, put many times, disconnect, repeat
Review comment:
fix
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] Sega76 commented on a change in pull request #9274: IGNITE-15169 Client mass reconnection test
Posted by GitBox <gi...@apache.org>.
Sega76 commented on a change in pull request #9274:
URL: https://github.com/apache/ignite/pull/9274#discussion_r734775448
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusApplication.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.TimeUnit;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.configuration.ClientConfiguration;
+import org.apache.ignite.internal.IgnitionEx;
+import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication;
+
+/** */
+@FunctionalInterface
+interface ContiniusClientInterface {
+ /** */
+ public void apply(ClientCache<UUID, byte[]> cache, long stopTime) throws InterruptedException;
+}
+
+/** Run multiple Thin Clients making some work for a given time
+ * connectClients connect, wait, disconnect, repeat
+ * putClients - connect, put many times, disconnect, repeat
+ * putAllClients - connect, putAll, disconnnet, repeat
+ */
+public class ThinClientContiniusApplication extends IgniteAwareApplication {
+ /** Size of one entry. */
+ private static final int DATA_SIZE = 15;
+
+ /** Time of one iteration. */
+ private static final int RUN_TIME = 1000;
+
+ /** Size of Map to putAll. */
+ private static final int PUT_ALL_SIZE = 1000;
+
+ /** {@inheritDoc} */
+ @Override protected void run(JsonNode jsonNode) throws Exception {
+ int connectClients = jsonNode.get("connectClients").asInt();
+
+ int putClients = jsonNode.get("putClients").asInt();
+
+ int putAllClients = jsonNode.get("putAllClients").asInt();
+
+ int runTime = jsonNode.get("runTime").asInt();
+
+ client.close();
+
+ ContiniusClientInterface connectClientsImpl = (ClientCache<UUID, byte[]> cache, long stopTyme) -> {
Review comment:
with the Consumer it would be like this
Consumer<IgniteClient> connectCons = (client) -> {
try {
TimeUnit.MILLISECONDS.sleep(RUN_TIME);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
};
Consumer<IgniteClient> putCons = (client) -> {
ClientCache<UUID, byte[]> cache = client.getOrCreateCache("testCache");
long stopTyme = System.currentTimeMillis() + RUN_TIME;
while (stopTyme > System.currentTimeMillis())
cache.put(UUID.randomUUID(), new byte[DATA_SIZE * 1024]);
};
Consumer<IgniteClient> putAllCons = (client) -> {
ClientCache<UUID, byte[]> cache = client.getOrCreateCache("testCache");
long stopTyme = System.currentTimeMillis() + RUN_TIME;
while (stopTyme > System.currentTimeMillis()) {
Map<UUID, byte[]> data = new HashMap<>();
for (int i = 0; i < PUT_ALL_SIZE; i++)
data.put(UUID.randomUUID(), new byte[DATA_SIZE * 1024]);
cache.putAll(data);
}
};
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusApplication.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.TimeUnit;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.configuration.ClientConfiguration;
+import org.apache.ignite.internal.IgnitionEx;
+import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication;
+
+/** */
+@FunctionalInterface
+interface ContiniusClientInterface {
+ /** */
Review comment:
we may use Function<IgniteClient, Void>
or Consumer< IgniteClient >
and using IgniteClient, it will be more convenient to extend this way if needed
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusRunner.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.List;
+import java.util.UUID;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.configuration.ClientConfiguration;
+
+/** Start Thin Client making some operations for a given time. */
+public class ThinClientContiniusRunner implements Runnable {
+ /** Time of one iteration. */
+ private static final int RUN_TIME = 1000;
+
+ /** Ignite Client configuration. */
+ private ClientConfiguration cfg;
+
+ /** Time of connection. */
+ private List<Long> connectTime;
+
+ /** Type of client. */
+ private ContiniusClientInterface func;
+
+ /** {@inheritDoc} */
Review comment:
we cannot specify here / ** {@inheritDoc} * /
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusRunner.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.List;
+import java.util.UUID;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.configuration.ClientConfiguration;
+
+/** Start Thin Client making some operations for a given time. */
+public class ThinClientContiniusRunner implements Runnable {
+ /** Time of one iteration. */
+ private static final int RUN_TIME = 1000;
Review comment:
pointed twice the field RUN_TIME
ThinClientContiniusApplication#RUN_TIME
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusRunner.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.List;
+import java.util.UUID;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.configuration.ClientConfiguration;
+
+/** Start Thin Client making some operations for a given time. */
+public class ThinClientContiniusRunner implements Runnable {
+ /** Time of one iteration. */
+ private static final int RUN_TIME = 1000;
+
+ /** Ignite Client configuration. */
+ private ClientConfiguration cfg;
+
+ /** Time of connection. */
+ private List<Long> connectTime;
+
+ /** Type of client. */
Review comment:
Function for IgniteClient.
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusRunner.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.List;
+import java.util.UUID;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.configuration.ClientConfiguration;
+
+/** Start Thin Client making some operations for a given time. */
+public class ThinClientContiniusRunner implements Runnable {
+ /** Time of one iteration. */
+ private static final int RUN_TIME = 1000;
+
+ /** Ignite Client configuration. */
+ private ClientConfiguration cfg;
+
+ /** Time of connection. */
+ private List<Long> connectTime;
+
+ /** Type of client. */
+ private ContiniusClientInterface func;
+
+ /** {@inheritDoc} */
+ ThinClientContiniusRunner(ClientConfiguration cfg, List<Long> connectTime, ContiniusClientInterface func) {
+ this.cfg = cfg;
+
+ this.func = func;
+
+ this.connectTime = connectTime;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void run() {
+ long connectStart;
+
+ cfg.setPartitionAwarenessEnabled(true);
+
+ while (!Thread.currentThread().isInterrupted()) {
+
+ connectStart = System.currentTimeMillis();
+
+ try (IgniteClient client = Ignition.startClient(cfg)) {
+ connectTime.add(System.currentTimeMillis() - connectStart);
+
+ ClientCache<UUID, byte[]> cache = client.getOrCreateCache("testCache");
+
+ long stopTyme = System.currentTimeMillis() + RUN_TIME;
+
+ func.apply(cache, stopTyme);
+
+ } catch (InterruptedException interruptedException) {
Review comment:
please add new line
}
catch (InterruptedException interruptedException) {
Thread.currentThread().interrupt();
}
##########
File path: modules/ducktests/tests/ignitetest/tests/thin_client_test.py
##########
@@ -60,3 +69,63 @@ def test_thin_client_compatibility(self, server_version, thin_client_version):
ignite.start()
thin_clients.run()
ignite.stop()
+
+ @cluster(num_nodes=4)
+ @ignite_versions(str(DEV_BRANCH))
+ @matrix(test_params=[{"connectClients": 150, "putClients": 0, "putAllClients": 0, "runTime": 60, "freeze": True},
+ {"connectClients": 150, "putClients": 0, "putAllClients": 0, "runTime": 60, "freeze": False},
+ {"connectClients": 150, "putClients": 2, "putAllClients": 0, "runTime": 60, "freeze": False},
+ {"connectClients": 150, "putClients": 0, "putAllClients": 2, "runTime": 60, "freeze": False}])
+ def test_thin_client_connect_time(self, ignite_version, test_params):
+ """
+ Thin client connect time test.
+ Determine how thin client connection time depend on cluster load
+ Demonstrate 4 situations:
+ - Cluster have too much clients
+ - Cluster have many put's
+ - Cluster have some putAll jobs
+ - One node hung for some time
+ """
+
+ server_config = \
+ IgniteConfiguration(version=IgniteVersion(ignite_version),
+ data_storage=DataStorageConfiguration(default=DataRegionConfiguration(persistent=True)),
+ client_connector_configuration=ClientConnectorConfiguration())
+
+ ignite = IgniteService(self.test_context, server_config, 2)
+
+ addresses = ignite.nodes[0].account.hostname + ":" + str(server_config.client_connector_configuration.port)
+
+ thin_clients = IgniteApplicationService(self.test_context,
+ IgniteThinClientConfiguration(addresses=addresses,
+ version=IgniteVersion(
+ ignite_version)),
+ java_class_name=self.JAVA_CLIENT_CLASS_NAME_CON,
+ params={"connectClients": test_params["connectClients"],
+ "putClients": test_params["putClients"],
+ "putAllClients": test_params["putAllClients"],
+ "runTime": test_params["runTime"]},
+ num_nodes=2,
+ startup_timeout_sec=60)
+
+ ignite.start()
+ ControlUtility(cluster=ignite).activate()
Review comment:
we may create once
control_utility = ControlUtility(ignite)
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusRunner.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.List;
+import java.util.UUID;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.configuration.ClientConfiguration;
+
+/** Start Thin Client making some operations for a given time. */
+public class ThinClientContiniusRunner implements Runnable {
+ /** Time of one iteration. */
+ private static final int RUN_TIME = 1000;
+
+ /** Ignite Client configuration. */
+ private ClientConfiguration cfg;
Review comment:
let's do inner fields final
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusRunner.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.List;
+import java.util.UUID;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.configuration.ClientConfiguration;
+
+/** Start Thin Client making some operations for a given time. */
+public class ThinClientContiniusRunner implements Runnable {
+ /** Time of one iteration. */
+ private static final int RUN_TIME = 1000;
+
+ /** Ignite Client configuration. */
+ private ClientConfiguration cfg;
+
+ /** Time of connection. */
+ private List<Long> connectTime;
+
+ /** Type of client. */
+ private ContiniusClientInterface func;
+
+ /** {@inheritDoc} */
+ ThinClientContiniusRunner(ClientConfiguration cfg, List<Long> connectTime, ContiniusClientInterface func) {
+ this.cfg = cfg;
Review comment:
in the constructor it is possible without split lines
please keep the sequence: cfg, connectTime, func
##########
File path: modules/ducktests/tests/ignitetest/tests/thin_client_test.py
##########
@@ -60,3 +69,63 @@ def test_thin_client_compatibility(self, server_version, thin_client_version):
ignite.start()
thin_clients.run()
ignite.stop()
+
+ @cluster(num_nodes=4)
+ @ignite_versions(str(DEV_BRANCH))
+ @matrix(test_params=[{"connectClients": 150, "putClients": 0, "putAllClients": 0, "runTime": 60, "freeze": True},
+ {"connectClients": 150, "putClients": 0, "putAllClients": 0, "runTime": 60, "freeze": False},
+ {"connectClients": 150, "putClients": 2, "putAllClients": 0, "runTime": 60, "freeze": False},
+ {"connectClients": 150, "putClients": 0, "putAllClients": 2, "runTime": 60, "freeze": False}])
+ def test_thin_client_connect_time(self, ignite_version, test_params):
+ """
+ Thin client connect time test.
+ Determine how thin client connection time depend on cluster load
+ Demonstrate 4 situations:
+ - Cluster have too much clients
+ - Cluster have many put's
+ - Cluster have some putAll jobs
+ - One node hung for some time
+ """
+
+ server_config = \
+ IgniteConfiguration(version=IgniteVersion(ignite_version),
+ data_storage=DataStorageConfiguration(default=DataRegionConfiguration(persistent=True)),
+ client_connector_configuration=ClientConnectorConfiguration())
+
+ ignite = IgniteService(self.test_context, server_config, 2)
+
+ addresses = ignite.nodes[0].account.hostname + ":" + str(server_config.client_connector_configuration.port)
+
+ thin_clients = IgniteApplicationService(self.test_context,
+ IgniteThinClientConfiguration(addresses=addresses,
+ version=IgniteVersion(
+ ignite_version)),
+ java_class_name=self.JAVA_CLIENT_CLASS_NAME_CON,
+ params={"connectClients": test_params["connectClients"],
+ "putClients": test_params["putClients"],
+ "putAllClients": test_params["putAllClients"],
+ "runTime": test_params["runTime"]},
+ num_nodes=2,
+ startup_timeout_sec=60)
Review comment:
startup_timeout_sec=60 is default value
##########
File path: modules/ducktests/tests/ignitetest/tests/thin_client_test.py
##########
@@ -60,3 +69,63 @@ def test_thin_client_compatibility(self, server_version, thin_client_version):
ignite.start()
thin_clients.run()
ignite.stop()
+
+ @cluster(num_nodes=4)
+ @ignite_versions(str(DEV_BRANCH))
+ @matrix(test_params=[{"connectClients": 150, "putClients": 0, "putAllClients": 0, "runTime": 60, "freeze": True},
+ {"connectClients": 150, "putClients": 0, "putAllClients": 0, "runTime": 60, "freeze": False},
+ {"connectClients": 150, "putClients": 2, "putAllClients": 0, "runTime": 60, "freeze": False},
+ {"connectClients": 150, "putClients": 0, "putAllClients": 2, "runTime": 60, "freeze": False}])
+ def test_thin_client_connect_time(self, ignite_version, test_params):
+ """
+ Thin client connect time test.
+ Determine how thin client connection time depend on cluster load
+ Demonstrate 4 situations:
+ - Cluster have too much clients
+ - Cluster have many put's
+ - Cluster have some putAll jobs
+ - One node hung for some time
+ """
+
+ server_config = \
+ IgniteConfiguration(version=IgniteVersion(ignite_version),
+ data_storage=DataStorageConfiguration(default=DataRegionConfiguration(persistent=True)),
+ client_connector_configuration=ClientConnectorConfiguration())
+
+ ignite = IgniteService(self.test_context, server_config, 2)
+
+ addresses = ignite.nodes[0].account.hostname + ":" + str(server_config.client_connector_configuration.port)
+
+ thin_clients = IgniteApplicationService(self.test_context,
+ IgniteThinClientConfiguration(addresses=addresses,
+ version=IgniteVersion(
+ ignite_version)),
+ java_class_name=self.JAVA_CLIENT_CLASS_NAME_CON,
+ params={"connectClients": test_params["connectClients"],
+ "putClients": test_params["putClients"],
+ "putAllClients": test_params["putAllClients"],
+ "runTime": test_params["runTime"]},
+ num_nodes=2,
+ startup_timeout_sec=60)
+
+ ignite.start()
+ ControlUtility(cluster=ignite).activate()
+
+ thin_clients.start_async()
+
+ if test_params["freeze"]:
+ thin_clients.await_event("START WAITING", 120, True)
+ for _ in range(4):
+ ignite.freeze_node(ignite.nodes[0])
+ time.sleep(3)
+ ignite.unfreeze_node(ignite.nodes[0])
+ time.sleep(7)
+
+ thin_clients.await_event("IGNITE_APPLICATION_FINISHED", 120)
+ thin_clients.stop(force_stop=True)
+
+ ControlUtility(cluster=ignite).baseline()
Review comment:
Why do we need to do
ControlUtility.baseline()
ControlUtility.deactivate()
?
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusRunner.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.List;
+import java.util.UUID;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.configuration.ClientConfiguration;
+
+/** Start Thin Client making some operations for a given time. */
+public class ThinClientContiniusRunner implements Runnable {
+ /** Time of one iteration. */
+ private static final int RUN_TIME = 1000;
+
+ /** Ignite Client configuration. */
+ private ClientConfiguration cfg;
+
+ /** Time of connection. */
+ private List<Long> connectTime;
+
+ /** Type of client. */
+ private ContiniusClientInterface func;
+
+ /** {@inheritDoc} */
+ ThinClientContiniusRunner(ClientConfiguration cfg, List<Long> connectTime, ContiniusClientInterface func) {
+ this.cfg = cfg;
+
+ this.func = func;
+
+ this.connectTime = connectTime;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void run() {
+ long connectStart;
+
+ cfg.setPartitionAwarenessEnabled(true);
Review comment:
partitionAwarenessEnabled = true by default
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusApplication.java
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.TimeUnit;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.configuration.ClientConfiguration;
+import org.apache.ignite.internal.IgnitionEx;
+import org.apache.ignite.internal.ducktest.utils.IgniteAwareApplication;
+
+/** */
+@FunctionalInterface
+interface ContiniusClientInterface {
+ /** */
+ public void apply(ClientCache<UUID, byte[]> cache, long stopTime) throws InterruptedException;
+}
+
+/** Run multiple Thin Clients making some work for a given time
+ * connectClients connect, wait, disconnect, repeat
+ * putClients - connect, put many times, disconnect, repeat
Review comment:
may be
/**
* Run multiple Ignite Clients for some work for a given time.
*/
without params
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusRunner.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.List;
+import java.util.UUID;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.configuration.ClientConfiguration;
+
+/** Start Thin Client making some operations for a given time. */
+public class ThinClientContiniusRunner implements Runnable {
+ /** Time of one iteration. */
+ private static final int RUN_TIME = 1000;
+
+ /** Ignite Client configuration. */
+ private ClientConfiguration cfg;
+
+ /** Time of connection. */
+ private List<Long> connectTime;
+
+ /** Type of client. */
+ private ContiniusClientInterface func;
+
+ /** {@inheritDoc} */
+ ThinClientContiniusRunner(ClientConfiguration cfg, List<Long> connectTime, ContiniusClientInterface func) {
+ this.cfg = cfg;
+
+ this.func = func;
+
+ this.connectTime = connectTime;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void run() {
+ long connectStart;
+
+ cfg.setPartitionAwarenessEnabled(true);
+
+ while (!Thread.currentThread().isInterrupted()) {
+
+ connectStart = System.currentTimeMillis();
+
+ try (IgniteClient client = Ignition.startClient(cfg)) {
+ connectTime.add(System.currentTimeMillis() - connectStart);
+
+ ClientCache<UUID, byte[]> cache = client.getOrCreateCache("testCache");
+
+ long stopTyme = System.currentTimeMillis() + RUN_TIME;
+
+ func.apply(cache, stopTyme);
+
+ } catch (InterruptedException interruptedException) {
+ Thread.currentThread().interrupt();
+ }
+ catch (Exception e) {
+ System.out.println(e);
Review comment:
I suggest using
e.printStackTrace ();
more informative
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] map7000 commented on a change in pull request #9274: IGNITE-15169 Client mass reconnection test
Posted by GitBox <gi...@apache.org>.
map7000 commented on a change in pull request #9274:
URL: https://github.com/apache/ignite/pull/9274#discussion_r735466139
##########
File path: modules/ducktests/tests/ignitetest/tests/thin_client_test.py
##########
@@ -60,3 +69,63 @@ def test_thin_client_compatibility(self, server_version, thin_client_version):
ignite.start()
thin_clients.run()
ignite.stop()
+
+ @cluster(num_nodes=4)
+ @ignite_versions(str(DEV_BRANCH))
+ @matrix(test_params=[{"connectClients": 150, "putClients": 0, "putAllClients": 0, "runTime": 60, "freeze": True},
+ {"connectClients": 150, "putClients": 0, "putAllClients": 0, "runTime": 60, "freeze": False},
+ {"connectClients": 150, "putClients": 2, "putAllClients": 0, "runTime": 60, "freeze": False},
+ {"connectClients": 150, "putClients": 0, "putAllClients": 2, "runTime": 60, "freeze": False}])
+ def test_thin_client_connect_time(self, ignite_version, test_params):
+ """
+ Thin client connect time test.
+ Determine how thin client connection time depend on cluster load
+ Demonstrate 4 situations:
+ - Cluster have too much clients
+ - Cluster have many put's
+ - Cluster have some putAll jobs
+ - One node hung for some time
+ """
+
+ server_config = \
+ IgniteConfiguration(version=IgniteVersion(ignite_version),
+ data_storage=DataStorageConfiguration(default=DataRegionConfiguration(persistent=True)),
+ client_connector_configuration=ClientConnectorConfiguration())
+
+ ignite = IgniteService(self.test_context, server_config, 2)
+
+ addresses = ignite.nodes[0].account.hostname + ":" + str(server_config.client_connector_configuration.port)
+
+ thin_clients = IgniteApplicationService(self.test_context,
+ IgniteThinClientConfiguration(addresses=addresses,
+ version=IgniteVersion(
+ ignite_version)),
+ java_class_name=self.JAVA_CLIENT_CLASS_NAME_CON,
+ params={"connectClients": test_params["connectClients"],
+ "putClients": test_params["putClients"],
+ "putAllClients": test_params["putAllClients"],
+ "runTime": test_params["runTime"]},
+ num_nodes=2,
+ startup_timeout_sec=60)
+
+ ignite.start()
+ ControlUtility(cluster=ignite).activate()
+
+ thin_clients.start_async()
+
+ if test_params["freeze"]:
+ thin_clients.await_event("START WAITING", 120, True)
+ for _ in range(4):
+ ignite.freeze_node(ignite.nodes[0])
+ time.sleep(3)
+ ignite.unfreeze_node(ignite.nodes[0])
+ time.sleep(7)
+
+ thin_clients.await_event("IGNITE_APPLICATION_FINISHED", 120)
+ thin_clients.stop(force_stop=True)
+
+ ControlUtility(cluster=ignite).baseline()
Review comment:
fix
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] map7000 commented on a change in pull request #9274: IGNITE-15169 Client mass reconnection test
Posted by GitBox <gi...@apache.org>.
map7000 commented on a change in pull request #9274:
URL: https://github.com/apache/ignite/pull/9274#discussion_r735465976
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusRunner.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.List;
+import java.util.UUID;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.configuration.ClientConfiguration;
+
+/** Start Thin Client making some operations for a given time. */
+public class ThinClientContiniusRunner implements Runnable {
+ /** Time of one iteration. */
+ private static final int RUN_TIME = 1000;
+
+ /** Ignite Client configuration. */
+ private ClientConfiguration cfg;
+
+ /** Time of connection. */
+ private List<Long> connectTime;
+
+ /** Type of client. */
+ private ContiniusClientInterface func;
+
+ /** {@inheritDoc} */
+ ThinClientContiniusRunner(ClientConfiguration cfg, List<Long> connectTime, ContiniusClientInterface func) {
+ this.cfg = cfg;
+
+ this.func = func;
+
+ this.connectTime = connectTime;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void run() {
+ long connectStart;
+
+ cfg.setPartitionAwarenessEnabled(true);
+
+ while (!Thread.currentThread().isInterrupted()) {
+
+ connectStart = System.currentTimeMillis();
+
+ try (IgniteClient client = Ignition.startClient(cfg)) {
+ connectTime.add(System.currentTimeMillis() - connectStart);
+
+ ClientCache<UUID, byte[]> cache = client.getOrCreateCache("testCache");
+
+ long stopTyme = System.currentTimeMillis() + RUN_TIME;
+
+ func.apply(cache, stopTyme);
+
+ } catch (InterruptedException interruptedException) {
+ Thread.currentThread().interrupt();
+ }
+ catch (Exception e) {
+ System.out.println(e);
Review comment:
fix
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite] map7000 commented on a change in pull request #9274: IGNITE-15169 Client mass reconnection test
Posted by GitBox <gi...@apache.org>.
map7000 commented on a change in pull request #9274:
URL: https://github.com/apache/ignite/pull/9274#discussion_r735467230
##########
File path: modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/thin_client_test/ThinClientContiniusRunner.java
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.thin_client_test;
+
+import java.util.List;
+import java.util.UUID;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.configuration.ClientConfiguration;
+
+/** Start Thin Client making some operations for a given time. */
+public class ThinClientContiniusRunner implements Runnable {
+ /** Time of one iteration. */
+ private static final int RUN_TIME = 1000;
+
+ /** Ignite Client configuration. */
+ private ClientConfiguration cfg;
+
+ /** Time of connection. */
+ private List<Long> connectTime;
+
+ /** Type of client. */
+ private ContiniusClientInterface func;
+
+ /** {@inheritDoc} */
+ ThinClientContiniusRunner(ClientConfiguration cfg, List<Long> connectTime, ContiniusClientInterface func) {
+ this.cfg = cfg;
+
+ this.func = func;
+
+ this.connectTime = connectTime;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void run() {
+ long connectStart;
+
+ cfg.setPartitionAwarenessEnabled(true);
Review comment:
fix
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org