Mmuzaf commented on a change in pull request #9186:
URL: https://github.com/apache/ignite/pull/9186#discussion_r788058711



##########
File path: 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotMXBeanTest.java
##########
@@ -81,14 +92,89 @@ public void testCancelSnapshot() throws Exception {
             mxBean::cancelSnapshot);
     }
 
-    /**
+    /** @throws Exception If fails. */
+    @Test
+    public void testRestoreSnapshot() throws Exception {
+        // TODO IGNITE-14999 Support dynamic restoration of encrypted 
snapshots.
+        if (encryption)
+            return;
+
+        IgniteEx ignite = startGridsWithSnapshot(2, CACHE_KEYS_RANGE, false);
+
+        DynamicMBean mReg0 = metricRegistry(grid(0).name(), null, 
SNAPSHOT_RESTORE_METRICS);
+        DynamicMBean mReg1 = metricRegistry(grid(1).name(), null, 
SNAPSHOT_RESTORE_METRICS);
+
+        assertEquals(0, (long)getMetric("endTime", mReg0));
+        assertEquals(0, (long)getMetric("endTime", mReg1));
+
+        getMxBean(ignite.name(), METRIC_GROUP, SnapshotMXBeanImpl.class, 
SnapshotMXBean.class)
+            .restoreSnapshot(SNAPSHOT_NAME, null);
+
+        assertTrue(GridTestUtils.waitForCondition(() -> 
(long)getMetric("endTime", mReg0) > 0, TIMEOUT));
+        assertTrue(GridTestUtils.waitForCondition(() -> 
(long)getMetric("endTime", mReg1) > 0, TIMEOUT));
+
+        assertCacheKeys(ignite.cache(DEFAULT_CACHE_NAME), CACHE_KEYS_RANGE);

Review comment:
       Lets' add the assertion that the restore future is also completed.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to