xtern commented on a change in pull request #9422:
URL: https://github.com/apache/ignite/pull/9422#discussion_r712563140
##########
File path:
modules/core/src/test/java/org/apache/ignite/internal/metric/SystemViewSelfTest.java
##########
@@ -2044,6 +2047,57 @@ public void testBaselineNodeAttributes() throws
Exception {
}
}
+ /** */
+ @Test
+ public void testSnapshots() throws Exception {
+ cleanPersistenceDir();
+
+ String dfltCacheGrp = "testGroup";
+
+ String testSnap0 = "testSnap0";
+ String testSnap1 = "testSnap1";
+
+ try (IgniteEx ignite = startGrid(getConfiguration()
+ .setCacheConfiguration(new
CacheConfiguration<>(DEFAULT_CACHE_NAME).setGroupName(dfltCacheGrp))
+ .setDataStorageConfiguration(
+ new
DataStorageConfiguration().setDefaultDataRegionConfiguration(
+ new
DataRegionConfiguration().setName("pds").setPersistenceEnabled(true)
+ )))
+ ) {
+ ignite.cluster().state(ClusterState.ACTIVE);
+
+ ignite.snapshot().createSnapshot(testSnap0).get();
+
+ SystemView<SnapshotView> views =
ignite.context().systemView().view(SNAPSHOTS_SYS_VIEW);
+
+ assertEquals(1, F.size(views.iterator()));
+
+ SnapshotView view = views.iterator().next();
+
+ assertEquals(testSnap0, view.snapshotName());
+ assertEquals(dfltCacheGrp, view.cacheGroup());
Review comment:
I suggest checking local partitions output, too.
something like
```
Collection<Integer> locParts = F.viewReadOnly(
ignite.cachex(DEFAULT_CACHE_NAME).context().topology().localPartitions(),
GridDhtLocalPartition::id);
assertEquals(S.compact(locParts), view.localPartitions());
```
but we should put some values into the cache. I don't think it is worth
creating 1024 (+1024 in the snapshot) files every time, so it is better to
limit this number in the cache configuration or add an extra predicate to check
if partitions were actually created (using IgnitePageStoreManager#exists for
example).
--
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]