kevinrr888 commented on code in PR #5547:
URL: https://github.com/apache/accumulo/pull/5547#discussion_r2116648969


##########
server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java:
##########
@@ -800,12 +801,14 @@ IteratorScope.scan, 
getServerContext().getTableConfiguration(TableId.of("foo")),
         () -> finalIter.seek(new Range(), Set.of(), false));
   }
 
-  private String[] uniqueDirPaths(int numOfDirs) {
+  private String[] uniqueDirPaths(int numOfDirs) throws IOException {
     String[] newDirs = new String[numOfDirs];
     for (int i = 0; i < newDirs.length; i++) {
-      File newDir = tempDir.toPath().resolve(testName() + i).toFile();
-      assertTrue(newDir.isDirectory() || newDir.mkdir(), "Failed to create 
directory: " + newDir);
-      newDirs[i] = newDir.getAbsolutePath();
+      Path newDir = tempDir.resolve(testName() + i);
+      if (!Files.isDirectory(newDir)) {
+        Files.createDirectories(newDir);
+      }
+      newDirs[i] = newDir.toAbsolutePath().toString();

Review Comment:
   would be good to keep a similar assertion: 
`assertTrue(Files.isDirectory(targetDir))`



##########
server/tserver/src/test/java/org/apache/accumulo/tserver/log/TestUpgradePathForWALogs.java:
##########
@@ -64,21 +63,22 @@ public class TestUpgradePathForWALogs extends WithTestNames 
{
   private TabletServer server;
 
   @TempDir
-  private static File tempDir;
+  private static java.nio.file.Path tempDir;
 
-  private static File perTestTempSubDir;
+  private static java.nio.file.Path perTestTempSubDir;
 
   @BeforeEach
   public void setUp() throws Exception {
     context = createMock(ServerContext.class);
     server = createMock(TabletServer.class);
 
     // Create a new subdirectory for each test
-    perTestTempSubDir = tempDir.toPath().resolve(testName()).toFile();
-    assertTrue(perTestTempSubDir.isDirectory() || perTestTempSubDir.mkdir(),
-        "Failed to create folder: " + perTestTempSubDir);
+    perTestTempSubDir = tempDir.resolve(testName());
+    if (!Files.isDirectory(perTestTempSubDir)) {
+      Files.createDirectories(perTestTempSubDir);
+    }

Review Comment:
   would be good to keep similar assertion: 
`assertTrue(Files.isDirectory(targetDir))`



-- 
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: notifications-unsubscr...@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to