From 27978adc42f36ffb9bf97edf8a96b5922deed7ec Mon Sep 17 00:00:00 2001 From: zstan Date: Thu, 19 Mar 2026 10:23:21 +0300 Subject: [PATCH 1/4] IGNITE-28664 Fix failed tests in Disk Page Compressions 4 Suite --- .../IgniteClusterSnapshotHandlerTest.java | 20 ++++++++++++------- .../IgniteClusterSnapshotRestoreBaseTest.java | 14 +++++++++++++ .../IgniteClusterSnapshotRestoreSelfTest.java | 17 +++++++++++----- ...lusterSnapshotRestoreWithIndexingTest.java | 13 +++++++----- 4 files changed, 47 insertions(+), 17 deletions(-) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotHandlerTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotHandlerTest.java index 7b679de89ad4f..da7e437f17028 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotHandlerTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotHandlerTest.java @@ -84,7 +84,7 @@ public class IgniteClusterSnapshotHandlerTest extends IgniteClusterSnapshotResto /** {@inheritDoc} */ @Override protected Function valueBuilder() { - return Integer::new; + return Integer::valueOf; } /** @@ -142,11 +142,13 @@ public void testClusterSnapshotHandlers() throws Exception { IgniteFuture fut = ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME, null); - GridTestUtils.assertThrowsAnyCause(log, () -> fut.get(TIMEOUT), IgniteCheckedException.class, expMsg); + runWithLogggedThreadDump(() -> + GridTestUtils.assertThrowsAnyCause(log, () -> fut.get(TIMEOUT), IgniteCheckedException.class, expMsg)); changeMetadataRequestIdOnDisk(reqIdRef.get()); - ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME, null).get(TIMEOUT); + runWithLogggedThreadDump(() -> + ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME, null).get(TIMEOUT)); assertCacheKeys(ignite.cache(DEFAULT_CACHE_NAME), CACHE_KEYS_RANGE); } @@ -212,7 +214,8 @@ public void testClusterSnapshotHandlerFailure() throws Exception { IgniteFuture fut = snp(ignite).createSnapshot(SNAPSHOT_NAME, null, false, onlyPrimary); - GridTestUtils.assertThrowsAnyCause(log, () -> fut.get(TIMEOUT), IgniteCheckedException.class, expMsg); + runWithLogggedThreadDump(() -> + GridTestUtils.assertThrowsAnyCause(log, () -> fut.get(TIMEOUT), IgniteCheckedException.class, expMsg)); failCreateFlag.set(false); @@ -224,11 +227,13 @@ public void testClusterSnapshotHandlerFailure() throws Exception { IgniteFuture fut0 = ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME, null); - GridTestUtils.assertThrowsAnyCause(log, () -> fut0.get(TIMEOUT), IgniteCheckedException.class, expMsg); + runWithLogggedThreadDump(() -> + GridTestUtils.assertThrowsAnyCause(log, () -> fut0.get(TIMEOUT), IgniteCheckedException.class, expMsg)); failRestoreFlag.set(false); - ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME, null).get(TIMEOUT); + runWithLogggedThreadDump(() -> + ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME, null).get(TIMEOUT)); assertCacheKeys(ignite.cache(DEFAULT_CACHE_NAME), CACHE_KEYS_RANGE); } @@ -406,7 +411,8 @@ public void testHandlerSnapshotLocation() throws Exception { ignite.destroyCache(DEFAULT_CACHE_NAME); awaitPartitionMapExchange(); - snpMgr.restoreSnapshot(snpName, snpDir.getAbsolutePath(), null).get(TIMEOUT); + runWithLogggedThreadDump(() -> + snpMgr.restoreSnapshot(snpName, snpDir.getAbsolutePath(), null).get(TIMEOUT)); } finally { U.delete(snpDir); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreBaseTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreBaseTest.java index 4393f08ce64fb..6c57bf2118de2 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreBaseTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreBaseTest.java @@ -24,7 +24,9 @@ import org.apache.ignite.internal.TestRecordingCommunicationSpi; import org.apache.ignite.internal.util.distributed.DistributedProcess; import org.apache.ignite.internal.util.distributed.SingleNodeMessage; +import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteFuture; +import org.apache.ignite.lang.IgniteFutureTimeoutException; /** * Snapshot restore test base. @@ -94,4 +96,16 @@ protected class BinaryValueBuilder implements Function { return builder.build(); } } + + /** Print thread dump if {@code IgniteFutureTimeoutException} is raised. */ + protected void runWithLogggedThreadDump(Runnable action) { + try { + action.run(); + } + catch (IgniteFutureTimeoutException ex) { + U.dumpThreads(log); + + throw ex; + } + } } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java index 409c1fb13cbd8..aa3a24fca9339 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java @@ -95,6 +95,9 @@ public class IgniteClusterSnapshotRestoreSelfTest extends IgniteClusterSnapshotR /** Reset consistent ID flag. */ private boolean resetConsistentId; + /** Timeout in milliseconds to await for snapshot operation being completed. */ + protected static final long TIMEOUT = 60_000; + /** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); @@ -117,7 +120,8 @@ public void testRestoreWithEmptyPartitions() throws Exception { // Skip check because some partitions will be empty - keysCnt == parts/2. Ignite ignite = startGridsWithSnapshot(1, keysCnt, false, true); - ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME, null).get(TIMEOUT); + runWithLogggedThreadDump(() -> + ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME, null).get(TIMEOUT)); assertCacheKeys(ignite.cache(DEFAULT_CACHE_NAME), keysCnt); } @@ -235,7 +239,8 @@ private void doRestoreAllGroups() throws Exception { TestRecordingCommunicationSpi.spi(g).record(SnapshotFilesRequestMessage.class); // Restore all cache groups. - grid(0).snapshot().restoreSnapshot(SNAPSHOT_NAME, null).get(TIMEOUT); + runWithLogggedThreadDump(() -> + grid(0).snapshot().restoreSnapshot(SNAPSHOT_NAME, null).get(TIMEOUT)); awaitPartitionMapExchange(true, true, null, true); @@ -277,8 +282,9 @@ private void checkStartClusterSnapshotRestoreMultithreaded(IntSupplier nodeIdxSu IgniteInternalFuture fut = GridTestUtils.runMultiThreadedAsync(() -> { try { - grid(nodeIdxSupplier.getAsInt()).snapshot().restoreSnapshot( - SNAPSHOT_NAME, Collections.singleton(DEFAULT_CACHE_NAME)).get(TIMEOUT); + runWithLogggedThreadDump(() -> + grid(nodeIdxSupplier.getAsInt()).snapshot().restoreSnapshot( + SNAPSHOT_NAME, Collections.singleton(DEFAULT_CACHE_NAME)).get(TIMEOUT)); successCnt.incrementAndGet(); } @@ -444,7 +450,8 @@ public void testClusterSnapshotRestoreOnSmallerTopology() throws Exception { resetBaselineTopology(); - grid(0).snapshot().restoreSnapshot(SNAPSHOT_NAME, Collections.singleton(DEFAULT_CACHE_NAME)).get(TIMEOUT); + runWithLogggedThreadDump(() -> + grid(0).snapshot().restoreSnapshot(SNAPSHOT_NAME, Collections.singleton(DEFAULT_CACHE_NAME)).get(TIMEOUT)); assertCacheKeys(grid(0).cache(DEFAULT_CACHE_NAME), CACHE_KEYS_RANGE); waitForEvents(EVT_CLUSTER_SNAPSHOT_RESTORE_STARTED, EVT_CLUSTER_SNAPSHOT_RESTORE_FINISHED); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreWithIndexingTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreWithIndexingTest.java index b8ebe10a7d202..ab14c005c3df4 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreWithIndexingTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreWithIndexingTest.java @@ -74,7 +74,8 @@ public void testBasicClusterSnapshotRestore() throws Exception { IgniteEx client = startGridsWithSnapshot(2, CACHE_KEYS_RANGE, true); - grid(0).snapshot().restoreSnapshot(SNAPSHOT_NAME, Collections.singleton(DEFAULT_CACHE_NAME)).get(TIMEOUT); + runWithLogggedThreadDump(() -> + grid(0).snapshot().restoreSnapshot(SNAPSHOT_NAME, Collections.singleton(DEFAULT_CACHE_NAME)).get(TIMEOUT)); // Only primary mode leads to index rebuild on restore. // Must wait until index rebuild finish so subsequent checks will pass. @@ -101,7 +102,8 @@ public void testBasicClusterSnapshotRestoreWithMetadata() throws Exception { forceCheckpoint(); - ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME, Collections.singleton(DEFAULT_CACHE_NAME)).get(TIMEOUT); + runWithLogggedThreadDump(() -> + ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME, Collections.singleton(DEFAULT_CACHE_NAME)).get(TIMEOUT)); // Only primary mode leads to index rebuild on restore. // Must wait until index rebuild finish so subsequent checks will pass. @@ -126,7 +128,8 @@ public void testClusterSnapshotRestoreOnBiggerTopology() throws Exception { startGridsWithCache(nodesCnt - 2, CACHE_KEYS_RANGE, valueBuilder(), dfltCacheCfg); - grid(0).snapshot().createSnapshot(SNAPSHOT_NAME).get(TIMEOUT); + runWithLogggedThreadDump(() -> + grid(0).snapshot().createSnapshot(SNAPSHOT_NAME).get(TIMEOUT)); startGrid(nodesCnt - 2); @@ -152,8 +155,8 @@ public void testClusterSnapshotRestoreOnBiggerTopology() throws Exception { forceCheckpoint(); // Restore from an empty node. - ignite.snapshot().restoreSnapshot( - SNAPSHOT_NAME, Collections.singleton(DEFAULT_CACHE_NAME)).get(TIMEOUT); + runWithLogggedThreadDump(() -> ignite.snapshot().restoreSnapshot( + SNAPSHOT_NAME, Collections.singleton(DEFAULT_CACHE_NAME)).get(TIMEOUT)); awaitPartitionMapExchange(); From ad82ad53d911cdfb9e5bed987d300404bd26c23e Mon Sep 17 00:00:00 2001 From: zstan Date: Mon, 18 May 2026 09:32:29 +0300 Subject: [PATCH 2/4] move timeout after review --- .../snapshot/IgniteClusterSnapshotRestoreBaseTest.java | 3 +++ .../snapshot/IgniteClusterSnapshotRestoreSelfTest.java | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreBaseTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreBaseTest.java index 6c57bf2118de2..0d642c305fba2 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreBaseTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreBaseTest.java @@ -41,6 +41,9 @@ public abstract class IgniteClusterSnapshotRestoreBaseTest extends AbstractSnaps /** Default shared cache group name. */ protected static final String SHARED_GRP = "shared"; + /** Timeout in milliseconds to await for snapshot operation being completed. */ + protected static final long TIMEOUT = 60_000; + /** * @param nodesCnt Nodes count. * @param keysCnt Number of keys to create. diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java index aa3a24fca9339..67e954559ff53 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java @@ -95,9 +95,6 @@ public class IgniteClusterSnapshotRestoreSelfTest extends IgniteClusterSnapshotR /** Reset consistent ID flag. */ private boolean resetConsistentId; - /** Timeout in milliseconds to await for snapshot operation being completed. */ - protected static final long TIMEOUT = 60_000; - /** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); From 31a6e3ce3f5ddc01f96077cbf6a6dac698aa4897 Mon Sep 17 00:00:00 2001 From: zstan Date: Mon, 18 May 2026 11:18:56 +0300 Subject: [PATCH 3/4] fix timeouts --- .../snapshot/AbstractSnapshotSelfTest.java | 13 +++++++++++++ .../IgniteClusterSnapshotHandlerTest.java | 3 +++ .../IgniteClusterSnapshotRestoreBaseTest.java | 17 ----------------- .../IgniteClusterSnapshotRestoreSelfTest.java | 3 +++ ...niteClusterSnapshotCheckWithIndexesTest.java | 7 ++++++- 5 files changed, 25 insertions(+), 18 deletions(-) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/AbstractSnapshotSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/AbstractSnapshotSelfTest.java index 19b0a4a3f750c..f8fe2420c2234 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/AbstractSnapshotSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/AbstractSnapshotSelfTest.java @@ -96,6 +96,7 @@ import org.apache.ignite.lang.IgniteBiTuple; import org.apache.ignite.lang.IgniteFuture; import org.apache.ignite.lang.IgniteFutureCancelledException; +import org.apache.ignite.lang.IgniteFutureTimeoutException; import org.apache.ignite.lang.IgnitePredicate; import org.apache.ignite.spi.discovery.DiscoverySpiCustomMessage; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; @@ -903,6 +904,18 @@ private void checkIncrementalSnapshotWalRecords(IgniteEx node, IncrementalSnapsh } } + /** Print thread dump if {@code IgniteFutureTimeoutException} is raised. */ + protected void runWithLogggedThreadDump(Runnable action) { + try { + action.run(); + } + catch (IgniteFutureTimeoutException ex) { + U.dumpThreads(log); + + throw ex; + } + } + /** * @param ignite Ignite instance to resolve discovery spi to. * @return BlockingCustomMessageDiscoverySpi instance. diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotHandlerTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotHandlerTest.java index da7e437f17028..c318d737c1cf3 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotHandlerTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotHandlerTest.java @@ -61,6 +61,9 @@ public class IgniteClusterSnapshotHandlerTest extends IgniteClusterSnapshotResto /** Custom snapshot handlers. */ private final List> handlers = new ArrayList<>(); + /** Timeout in milliseconds to await for snapshot operation being completed. */ + protected static final long TIMEOUT = 60_000; + /** Extensions plugin provider. */ private final PluginProvider pluginProvider = new AbstractTestPluginProvider() { @Override public String name() { diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreBaseTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreBaseTest.java index 0d642c305fba2..4393f08ce64fb 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreBaseTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreBaseTest.java @@ -24,9 +24,7 @@ import org.apache.ignite.internal.TestRecordingCommunicationSpi; import org.apache.ignite.internal.util.distributed.DistributedProcess; import org.apache.ignite.internal.util.distributed.SingleNodeMessage; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteFuture; -import org.apache.ignite.lang.IgniteFutureTimeoutException; /** * Snapshot restore test base. @@ -41,9 +39,6 @@ public abstract class IgniteClusterSnapshotRestoreBaseTest extends AbstractSnaps /** Default shared cache group name. */ protected static final String SHARED_GRP = "shared"; - /** Timeout in milliseconds to await for snapshot operation being completed. */ - protected static final long TIMEOUT = 60_000; - /** * @param nodesCnt Nodes count. * @param keysCnt Number of keys to create. @@ -99,16 +94,4 @@ protected class BinaryValueBuilder implements Function { return builder.build(); } } - - /** Print thread dump if {@code IgniteFutureTimeoutException} is raised. */ - protected void runWithLogggedThreadDump(Runnable action) { - try { - action.run(); - } - catch (IgniteFutureTimeoutException ex) { - U.dumpThreads(log); - - throw ex; - } - } } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java index 67e954559ff53..aa3a24fca9339 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java @@ -95,6 +95,9 @@ public class IgniteClusterSnapshotRestoreSelfTest extends IgniteClusterSnapshotR /** Reset consistent ID flag. */ private boolean resetConsistentId; + /** Timeout in milliseconds to await for snapshot operation being completed. */ + protected static final long TIMEOUT = 60_000; + /** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotCheckWithIndexesTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotCheckWithIndexesTest.java index c7f1316077635..b8aa76218bd41 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotCheckWithIndexesTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotCheckWithIndexesTest.java @@ -36,6 +36,9 @@ * Cluster-wide snapshot test check command with indexes. */ public class IgniteClusterSnapshotCheckWithIndexesTest extends AbstractSnapshotSelfTest { + /** Timeout in milliseconds to await for snapshot operation being completed. */ + protected static final long TIMEOUT = 60_000; + /** @throws Exception If fails. */ @Test public void testClusterSnapshotCheckEmptyCache() throws Exception { @@ -87,7 +90,9 @@ public void testClusterSnapshotCheckWithNodeFilter() throws Exception { cache2.put(i, new Account(i, i)); } - createAndCheckSnapshot(grid(0), SNAPSHOT_NAME, null, TIMEOUT); + runWithLogggedThreadDump(() -> + createAndCheckSnapshot(grid(0), SNAPSHOT_NAME, null, TIMEOUT) + ); IdleVerifyResult res = grid(0).context().cache().context().snapshotMgr() .checkSnapshot(SNAPSHOT_NAME, null).get().idleVerifyResult(); From 11f23ea43230fb8d22d9921cab0fd9bf67121ba6 Mon Sep 17 00:00:00 2001 From: zstan Date: Mon, 18 May 2026 16:45:34 +0300 Subject: [PATCH 4/4] fix after review --- .../snapshot/AbstractSnapshotSelfTest.java | 2 +- .../snapshot/IgniteClusterSnapshotHandlerTest.java | 12 ++++++------ .../IgniteClusterSnapshotRestoreSelfTest.java | 8 ++++---- .../snapshot/IgniteSnapshotMXBeanTest.java | 3 +++ .../IgniteClusterSnapshotCheckWithIndexesTest.java | 2 +- ...IgniteClusterSnapshotRestoreWithIndexingTest.java | 11 +++++++---- 6 files changed, 22 insertions(+), 16 deletions(-) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/AbstractSnapshotSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/AbstractSnapshotSelfTest.java index f8fe2420c2234..8857a4ddd656e 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/AbstractSnapshotSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/AbstractSnapshotSelfTest.java @@ -905,7 +905,7 @@ private void checkIncrementalSnapshotWalRecords(IgniteEx node, IncrementalSnapsh } /** Print thread dump if {@code IgniteFutureTimeoutException} is raised. */ - protected void runWithLogggedThreadDump(Runnable action) { + protected void runWithLoggedThreadDump(Runnable action) { try { action.run(); } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotHandlerTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotHandlerTest.java index c318d737c1cf3..830aa605ef549 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotHandlerTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotHandlerTest.java @@ -145,12 +145,12 @@ public void testClusterSnapshotHandlers() throws Exception { IgniteFuture fut = ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME, null); - runWithLogggedThreadDump(() -> + runWithLoggedThreadDump(() -> GridTestUtils.assertThrowsAnyCause(log, () -> fut.get(TIMEOUT), IgniteCheckedException.class, expMsg)); changeMetadataRequestIdOnDisk(reqIdRef.get()); - runWithLogggedThreadDump(() -> + runWithLoggedThreadDump(() -> ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME, null).get(TIMEOUT)); assertCacheKeys(ignite.cache(DEFAULT_CACHE_NAME), CACHE_KEYS_RANGE); @@ -217,7 +217,7 @@ public void testClusterSnapshotHandlerFailure() throws Exception { IgniteFuture fut = snp(ignite).createSnapshot(SNAPSHOT_NAME, null, false, onlyPrimary); - runWithLogggedThreadDump(() -> + runWithLoggedThreadDump(() -> GridTestUtils.assertThrowsAnyCause(log, () -> fut.get(TIMEOUT), IgniteCheckedException.class, expMsg)); failCreateFlag.set(false); @@ -230,12 +230,12 @@ public void testClusterSnapshotHandlerFailure() throws Exception { IgniteFuture fut0 = ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME, null); - runWithLogggedThreadDump(() -> + runWithLoggedThreadDump(() -> GridTestUtils.assertThrowsAnyCause(log, () -> fut0.get(TIMEOUT), IgniteCheckedException.class, expMsg)); failRestoreFlag.set(false); - runWithLogggedThreadDump(() -> + runWithLoggedThreadDump(() -> ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME, null).get(TIMEOUT)); assertCacheKeys(ignite.cache(DEFAULT_CACHE_NAME), CACHE_KEYS_RANGE); @@ -414,7 +414,7 @@ public void testHandlerSnapshotLocation() throws Exception { ignite.destroyCache(DEFAULT_CACHE_NAME); awaitPartitionMapExchange(); - runWithLogggedThreadDump(() -> + runWithLoggedThreadDump(() -> snpMgr.restoreSnapshot(snpName, snpDir.getAbsolutePath(), null).get(TIMEOUT)); } finally { diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java index aa3a24fca9339..78ec729ec931b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java @@ -120,7 +120,7 @@ public void testRestoreWithEmptyPartitions() throws Exception { // Skip check because some partitions will be empty - keysCnt == parts/2. Ignite ignite = startGridsWithSnapshot(1, keysCnt, false, true); - runWithLogggedThreadDump(() -> + runWithLoggedThreadDump(() -> ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME, null).get(TIMEOUT)); assertCacheKeys(ignite.cache(DEFAULT_CACHE_NAME), keysCnt); @@ -239,7 +239,7 @@ private void doRestoreAllGroups() throws Exception { TestRecordingCommunicationSpi.spi(g).record(SnapshotFilesRequestMessage.class); // Restore all cache groups. - runWithLogggedThreadDump(() -> + runWithLoggedThreadDump(() -> grid(0).snapshot().restoreSnapshot(SNAPSHOT_NAME, null).get(TIMEOUT)); awaitPartitionMapExchange(true, true, null, true); @@ -282,7 +282,7 @@ private void checkStartClusterSnapshotRestoreMultithreaded(IntSupplier nodeIdxSu IgniteInternalFuture fut = GridTestUtils.runMultiThreadedAsync(() -> { try { - runWithLogggedThreadDump(() -> + runWithLoggedThreadDump(() -> grid(nodeIdxSupplier.getAsInt()).snapshot().restoreSnapshot( SNAPSHOT_NAME, Collections.singleton(DEFAULT_CACHE_NAME)).get(TIMEOUT)); @@ -450,7 +450,7 @@ public void testClusterSnapshotRestoreOnSmallerTopology() throws Exception { resetBaselineTopology(); - runWithLogggedThreadDump(() -> + runWithLoggedThreadDump(() -> grid(0).snapshot().restoreSnapshot(SNAPSHOT_NAME, Collections.singleton(DEFAULT_CACHE_NAME)).get(TIMEOUT)); assertCacheKeys(grid(0).cache(DEFAULT_CACHE_NAME), CACHE_KEYS_RANGE); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotMXBeanTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotMXBeanTest.java index d1a804ada61c7..cf359d313ef52 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotMXBeanTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotMXBeanTest.java @@ -53,6 +53,9 @@ public class IgniteSnapshotMXBeanTest extends AbstractSnapshotSelfTest { /** Snapshot group name. */ private static final String SNAPSHOT_GROUP = "Snapshot"; + /** Timeout in milliseconds to await for snapshot operation being completed. */ + protected static final long TIMEOUT = 60_000; + /** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { return super.getConfiguration(igniteInstanceName) diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotCheckWithIndexesTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotCheckWithIndexesTest.java index b8aa76218bd41..f819ba3925542 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotCheckWithIndexesTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotCheckWithIndexesTest.java @@ -90,7 +90,7 @@ public void testClusterSnapshotCheckWithNodeFilter() throws Exception { cache2.put(i, new Account(i, i)); } - runWithLogggedThreadDump(() -> + runWithLoggedThreadDump(() -> createAndCheckSnapshot(grid(0), SNAPSHOT_NAME, null, TIMEOUT) ); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreWithIndexingTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreWithIndexingTest.java index ab14c005c3df4..9ccda9c73b614 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreWithIndexingTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreWithIndexingTest.java @@ -57,6 +57,9 @@ public class IgniteClusterSnapshotRestoreWithIndexingTest extends IgniteClusterS /** Number of cache keys to pre-create at node start. */ private static final int CACHE_KEYS_RANGE = 10_000; + /** Timeout in milliseconds to await for snapshot operation being completed. */ + protected static final long TIMEOUT = 60_000; + /** {@inheritDoc} */ @Override protected CacheConfiguration txCacheConfig(CacheConfiguration ccfg) { return super.txCacheConfig(ccfg).setSqlIndexMaxInlineSize(255).setSqlSchema("PUBLIC") @@ -74,7 +77,7 @@ public void testBasicClusterSnapshotRestore() throws Exception { IgniteEx client = startGridsWithSnapshot(2, CACHE_KEYS_RANGE, true); - runWithLogggedThreadDump(() -> + runWithLoggedThreadDump(() -> grid(0).snapshot().restoreSnapshot(SNAPSHOT_NAME, Collections.singleton(DEFAULT_CACHE_NAME)).get(TIMEOUT)); // Only primary mode leads to index rebuild on restore. @@ -102,7 +105,7 @@ public void testBasicClusterSnapshotRestoreWithMetadata() throws Exception { forceCheckpoint(); - runWithLogggedThreadDump(() -> + runWithLoggedThreadDump(() -> ignite.snapshot().restoreSnapshot(SNAPSHOT_NAME, Collections.singleton(DEFAULT_CACHE_NAME)).get(TIMEOUT)); // Only primary mode leads to index rebuild on restore. @@ -128,7 +131,7 @@ public void testClusterSnapshotRestoreOnBiggerTopology() throws Exception { startGridsWithCache(nodesCnt - 2, CACHE_KEYS_RANGE, valueBuilder(), dfltCacheCfg); - runWithLogggedThreadDump(() -> + runWithLoggedThreadDump(() -> grid(0).snapshot().createSnapshot(SNAPSHOT_NAME).get(TIMEOUT)); startGrid(nodesCnt - 2); @@ -155,7 +158,7 @@ public void testClusterSnapshotRestoreOnBiggerTopology() throws Exception { forceCheckpoint(); // Restore from an empty node. - runWithLogggedThreadDump(() -> ignite.snapshot().restoreSnapshot( + runWithLoggedThreadDump(() -> ignite.snapshot().restoreSnapshot( SNAPSHOT_NAME, Collections.singleton(DEFAULT_CACHE_NAME)).get(TIMEOUT)); awaitPartitionMapExchange();