You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2021/06/15 18:17:16 UTC

[GitHub] [accumulo] milleruntime commented on a change in pull request #2167: Make ExternalCompactionIT faster by reusing MiniAccumuloCluster

milleruntime commented on a change in pull request #2167:
URL: https://github.com/apache/accumulo/pull/2167#discussion_r652042471



##########
File path: test/src/main/java/org/apache/accumulo/test/ExternalCompactionIT.java
##########
@@ -193,22 +195,55 @@ public boolean accept(Key k, Value v) {
 
   }
 
+  @Before
+  public void setUp() throws Exception {
+    if (SharedMiniClusterBase.getCluster() == null) {
+      SharedMiniClusterBase.startMiniClusterWithConfig(this);
+    }
+  }
+
+  private void stopProcess(Process process) throws Exception {
+    if (process.supportsNormalTermination()) {
+      process.destroyForcibly();
+    } else {
+      LOG.info("Stopping process manually");
+      new ProcessBuilder("kill", Long.toString(process.pid())).start();
+      process.waitFor();
+    }
+  }
+
+  private void cleanupTables(String... tables) {
+    try (AccumuloClient client = Accumulo.newClient()
+        .from(SharedMiniClusterBase.getCluster().getClientProperties()).build()) {
+      for (String table : tables) {
+        try {
+          client.tableOperations().delete(table);
+        } catch (Exception e) {
+          fail("Error deleting table: " + table + ", msg: " + e.getMessage());
+        }
+      }
+    }
+  }

Review comment:
       Looks like you have a unique table name per test. If that is the case do you need to delete them after each test?




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

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