This is an automated email from the ASF dual-hosted git repository.
sergeychugunov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new e5d6f038345 IGNITE-25455 Reduce memory requirements of
largeUserAttributes* tests (#12089)
e5d6f038345 is described below
commit e5d6f0383452b18cc0d87ba1727179f90ce64a3c
Author: Sergey Chugunov <[email protected]>
AuthorDate: Thu May 29 12:06:06 2025 +0400
IGNITE-25455 Reduce memory requirements of largeUserAttributes* tests
(#12089)
---
.../zk/internal/ZookeeperDiscoverySpiTestBase.java | 16 ++--
...perDiscoveryTopologyChangeAndReconnectTest.java | 89 ++++++++++++++--------
2 files changed, 64 insertions(+), 41 deletions(-)
diff --git
a/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiTestBase.java
b/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiTestBase.java
index b8eb482848f..fbcd959fe63 100644
---
a/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiTestBase.java
+++
b/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiTestBase.java
@@ -504,15 +504,13 @@ class ZookeeperDiscoverySpiTestBase extends
GridCommonAbstractTest {
if (!isMultiJvm())
cfg.setLocalEventListeners(lsnrs);
- if (persistence) {
- DataStorageConfiguration memCfg = new DataStorageConfiguration()
- .setDefaultDataRegionConfiguration(new
DataRegionConfiguration().setMaxSize(100 * 1024 * 1024).
- setPersistenceEnabled(true))
- .setPageSize(1024)
- .setWalMode(WALMode.LOG_ONLY);
-
- cfg.setDataStorageConfiguration(memCfg);
- }
+ DataStorageConfiguration memCfg = new DataStorageConfiguration()
+ .setDefaultDataRegionConfiguration(new
DataRegionConfiguration().setMaxSize(100 * 1024 * 1024).
+ setPersistenceEnabled(persistence))
+ .setPageSize(1024)
+ .setWalMode(WALMode.LOG_ONLY);
+
+ cfg.setDataStorageConfiguration(memCfg);
if (testCommSpi)
cfg.setCommunicationSpi(new ZkTestCommunicationSpi());
diff --git
a/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryTopologyChangeAndReconnectTest.java
b/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryTopologyChangeAndReconnectTest.java
index f38baa7fc03..67e5bf8a066 100644
---
a/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryTopologyChangeAndReconnectTest.java
+++
b/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryTopologyChangeAndReconnectTest.java
@@ -300,19 +300,26 @@ public class
ZookeeperDiscoveryTopologyChangeAndReconnectTest extends ZookeeperD
*/
@Test
public void testLargeUserAttribute1() throws Exception {
- initLargeAttribute();
+ try {
+ initLargeAttribute();
- startGrid(0);
+ startGrid(0);
- checkZkNodesCleanup();
+ checkZkNodesCleanup();
- userAttrs = null;
+ userAttrs = null;
- startGrid(1);
+ startGrid(1);
- helper.waitForEventsAcks(ignite(0));
+ helper.waitForEventsAcks(ignite(0));
+
+ waitForTopology(2);
+ }
+ finally {
+ zkCluster.close();
- waitForTopology(2);
+ zkCluster = null;
+ }
}
/**
@@ -322,15 +329,24 @@ public class
ZookeeperDiscoveryTopologyChangeAndReconnectTest extends ZookeeperD
*/
@Test
public void testLargeUserAttribute2() throws Exception {
- startGrid(0);
+ try {
+ startGrid(0);
- initLargeAttribute();
+ initLargeAttribute();
- startGrid(1);
+ startGrid(1);
- helper.waitForEventsAcks(ignite(0));
+ helper.waitForEventsAcks(ignite(0));
- checkZkNodesCleanup();
+ checkZkNodesCleanup();
+ }
+ finally {
+ zkCluster.close();
+
+ zkCluster = null;
+
+ userAttrs = null;
+ }
}
/**
@@ -341,28 +357,37 @@ public class
ZookeeperDiscoveryTopologyChangeAndReconnectTest extends ZookeeperD
*/
@Test
public void testLargeUserAttribute3() throws Exception {
- Set<Integer> idxs = ThreadLocalRandom.current()
- .ints(0, 10)
- .distinct()
- .limit(3)
- .boxed()
- .collect(Collectors.toSet());
-
- for (int i = 0; i < 10; i++) {
- info("Iteration: " + i);
-
- if (idxs.contains(i))
- initLargeAttribute();
- else
- userAttrs = null;
+ try {
+ Set<Integer> idxs = ThreadLocalRandom.current()
+ .ints(0, 6)
+ .distinct()
+ .limit(3)
+ .boxed()
+ .collect(Collectors.toSet());
+
+ for (int i = 0; i < 6; i++) {
+ info("Iteration: " + i);
+
+ if (idxs.contains(i))
+ initLargeAttribute();
+ else
+ userAttrs = null;
+
+ if (i > 3)
+ startClientGrid(i);
+ else
+ startGrid(i);
+ }
- if (i > 5)
- startClientGrid(i);
- else
- startGrid(i);
+ waitForTopology(6);
}
+ finally {
+ zkCluster.close();
- waitForTopology(10);
+ zkCluster = null;
+
+ userAttrs = null;
+ }
}
/**
@@ -371,7 +396,7 @@ public class
ZookeeperDiscoveryTopologyChangeAndReconnectTest extends ZookeeperD
private void initLargeAttribute() {
userAttrs = new HashMap<>();
- int[] attr = new int[1024 * 1024 +
ThreadLocalRandom.current().nextInt(1024 * 512)];
+ int[] attr = new int[1024 * 1024 +
ThreadLocalRandom.current().nextInt(1024 * 64)];
for (int i = 0; i < attr.length; i++)
attr[i] = i;