This is an automated email from the ASF dual-hosted git repository.
wernerdv 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 248374dc3c3 IGNITE-29200 Fix flaky
ResumeCreateIndexTest.testConcurrentBuildNewIndexAndRebuildIndexes1 (#13738)
248374dc3c3 is described below
commit 248374dc3c39c786f8f3cfab60a1e0bdd10b18cb
Author: Dmitry Werner <[email protected]>
AuthorDate: Wed Oct 28 21:34:57 2026 +0800
IGNITE-29200 Fix flaky
ResumeCreateIndexTest.testConcurrentBuildNewIndexAndRebuildIndexes1 (#13738)
---
.../cache/index/ResumeCreateIndexTest.java | 29 +++++++++++++++++++---
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ResumeCreateIndexTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ResumeCreateIndexTest.java
index b9bc0844a38..777c4c953d9 100644
---
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ResumeCreateIndexTest.java
+++
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/ResumeCreateIndexTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache.index;
import java.util.List;
import java.util.Map;
+import java.util.function.Consumer;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction;
@@ -41,6 +42,7 @@ import
org.apache.ignite.testframework.junits.WithSystemProperty;
import org.junit.Test;
import static
org.apache.ignite.IgniteSystemProperties.IGNITE_INDEX_REBUILD_BATCH_SIZE;
+import static org.apache.ignite.cluster.ClusterState.ACTIVE;
import static
org.apache.ignite.internal.processors.query.aware.IndexBuildStatusHolder.Status.COMPLETE;
import static
org.apache.ignite.internal.processors.query.aware.IndexBuildStatusHolder.Status.INIT;
import static
org.apache.ignite.internal.processors.query.aware.IndexBuildStatusStorage.KEY_PREFIX;
@@ -181,7 +183,7 @@ public class ResumeCreateIndexTest extends
AbstractRebuildIndexTest {
public void testConcurrentBuildNewIndexAndRebuildIndexes0() throws
Exception {
String cacheName = DEFAULT_CACHE_NAME;
- IgniteEx n = prepareNodeToCreateNewIndex(cacheName, 100_000, true);
+ IgniteEx n = prepareNodeToCreateNewIndex(cacheName, 100_000, true, cfg
-> cfg.setBuildIndexThreadPoolSize(2));
String idxName = "IDX0";
SlowdownBuildIndexConsumer slowdownIdxCreateConsumer =
addSlowdownIdxCreateConsumer(n, idxName, 0);
@@ -231,7 +233,7 @@ public class ResumeCreateIndexTest extends
AbstractRebuildIndexTest {
public void testConcurrentBuildNewIndexAndRebuildIndexes1() throws
Exception {
String cacheName = DEFAULT_CACHE_NAME;
- IgniteEx n = prepareNodeToCreateNewIndex(cacheName, 100_000, true);
+ IgniteEx n = prepareNodeToCreateNewIndex(cacheName, 100_000, true, cfg
-> cfg.setBuildIndexThreadPoolSize(2));
SlowdownBuildIndexConsumer slowdownRebuildIdxConsumer =
addSlowdownRebuildIndexConsumer(n, cacheName, 10);
assertTrue(forceRebuildIndexes(n,
n.cachex(cacheName).context()).isEmpty());
@@ -426,19 +428,38 @@ public class ResumeCreateIndexTest extends
AbstractRebuildIndexTest {
assertEquals(expNewIdx, status.buildNewIndexes());
}
+ /** */
+ private IgniteEx prepareNodeToCreateNewIndex(String cacheName, int cnt,
boolean disableCp) throws Exception {
+ return prepareNodeToCreateNewIndex(cacheName, cnt, disableCp, null);
+ }
+
/**
* Creating a node and filling the cache.
*
* @param cacheName Cache name.
* @param cnt Entry count.
* @param disableCp Disable checkpoint.
+ * @param cfgC Configuration mutator.
* @return New node.
* @throws Exception If failed.
*/
- private IgniteEx prepareNodeToCreateNewIndex(String cacheName, int cnt,
boolean disableCp) throws Exception {
+ private IgniteEx prepareNodeToCreateNewIndex(
+ String cacheName,
+ int cnt,
+ boolean disableCp,
+ Consumer<IgniteConfiguration> cfgC
+ ) throws Exception {
IndexesRebuildTaskEx.prepareBeforeNodeStart();
- IgniteEx n = startGrid(0);
+ IgniteEx n;
+
+ if (cfgC == null)
+ n = startGrid(0);
+ else {
+ n = startGrid(0, cfgC);
+
+ n.cluster().state(ACTIVE);
+ }
populate(n.cache(cacheName), cnt);