timoninmaxim commented on code in PR #10527:
URL: https://github.com/apache/ignite/pull/10527#discussion_r1103866655


##########
modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java:
##########
@@ -2810,4 +2815,35 @@ protected DistributedChangeableProperty<Serializable> 
computeJobWorkerInterruptT
 
         return timeoutProperty;
     }
+
+    /** Clean work directory, excluding snapshot directory. */
+    protected IgniteEx restartWithCleanPersistence(int nodes, 
Collection<String> caches) throws Exception {
+        stopAllGrids();
+
+        assertTrue(U.delete(Paths.get(U.defaultWorkDirectory(), 
"cp").toFile()));
+        assertTrue(U.delete(Paths.get(U.defaultWorkDirectory(), 
DFLT_MARSHALLER_PATH).toFile()));
+
+        deleteNodesDirs(nodes, DFLT_STORE_DIR, DFLT_BINARY_METADATA_PATH, 
DFLT_WAL_PATH, DFLT_WAL_ARCHIVE_PATH);
+
+        IgniteEx ign = startGrids(nodes);
+
+        ign.cluster().state(ClusterState.ACTIVE);
+
+        // Destroy caches configured with IgniteConfiguration before restoring 
snapshot.
+        ign.destroyCaches(caches);
+
+        awaitPartitionMapExchange();
+
+        return ign;
+    }
+
+    /** */
+    private void deleteNodesDirs(int nodes, String... dirs) throws 
IgniteCheckedException {

Review Comment:
   Remove this function at all. Reuse `cleanPersistenceDir` instead.



-- 
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