dlmarion commented on code in PR #3665:
URL: https://github.com/apache/accumulo/pull/3665#discussion_r1277444473


##########
test/src/main/java/org/apache/accumulo/test/functional/CompactionIT.java:
##########
@@ -189,114 +170,6 @@ public void configureMiniCluster(MiniAccumuloConfigImpl 
cfg, Configuration hadoo
     hadoopCoreSite.set("fs.file.impl", RawLocalFileSystem.class.getName());
   }
 
-  @Test
-  public void testBadSelector() throws Exception {
-    try (AccumuloClient c = 
Accumulo.newClient().from(getClientProps()).build()) {
-      final String tableName = getUniqueNames(1)[0];
-      NewTableConfiguration tc = new NewTableConfiguration();
-      // Ensure compactions don't kick off
-      tc.setProperties(Map.of(Property.TABLE_MAJC_RATIO.getKey(), "10.0"));
-      c.tableOperations().create(tableName, tc);
-      // Create multiple RFiles
-      try (BatchWriter bw = c.createBatchWriter(tableName)) {
-        for (int i = 1; i <= 4; i++) {
-          Mutation m = new Mutation(Integer.toString(i));
-          m.put("cf", "cq", new Value());
-          bw.addMutation(m);
-          bw.flush();
-          // flush often to create multiple files to compact
-          c.tableOperations().flush(tableName, null, null, true);
-        }
-      }
-
-      CompactionConfig config = new CompactionConfig()
-          .setSelector(new PluginConfig(ErrorThrowingSelector.class.getName(), 
Map.of()))
-          .setWait(true);
-      assertThrows(AccumuloException.class, () -> 
c.tableOperations().compact(tableName, config));
-
-      List<String> rows = new ArrayList<>();
-      c.createScanner(tableName).forEach((k, v) -> 
rows.add(k.getRow().toString()));
-      assertEquals(List.of("1", "2", "3", "4"), rows);
-
-      assertNoCompactionMetadata(tableName);
-    }
-  }
-
-  @Test
-  public void testCompactionWithTableIterator() throws Exception {
-    String table1 = this.getUniqueNames(1)[0];
-    try (AccumuloClient client = 
Accumulo.newClient().from(getClientProps()).build()) {
-      client.tableOperations().create(table1);
-      try (BatchWriter bw = client.createBatchWriter(table1)) {
-        for (int i = 1; i <= 4; i++) {
-          Mutation m = new Mutation(Integer.toString(i));
-          m.put("cf", "cq", new Value());
-          bw.addMutation(m);
-          bw.flush();
-          // flush often to create multiple files to compact
-          client.tableOperations().flush(table1, null, null, true);
-        }
-      }
-
-      IteratorSetting setting = new IteratorSetting(50, "delete", 
DevNull.class);
-      client.tableOperations().attachIterator(table1, setting, 
EnumSet.of(IteratorScope.majc));
-      client.tableOperations().compact(table1, new 
CompactionConfig().setWait(true));
-
-      try (Scanner s = client.createScanner(table1)) {
-        assertFalse(s.iterator().hasNext());
-      }
-
-      assertNoCompactionMetadata(table1);
-    }
-  }
-
-  @Test
-  public void testUserCompactionCancellation() throws Exception {
-    final String table1 = this.getUniqueNames(1)[0];
-    try (AccumuloClient client = 
Accumulo.newClient().from(getClientProps()).build()) {
-      client.tableOperations().create(table1);
-      try (BatchWriter bw = client.createBatchWriter(table1)) {
-        for (int i = 1; i <= MAX_DATA; i++) {
-          Mutation m = new Mutation(Integer.toString(i));
-          m.put("cf", "cq", new Value());
-          bw.addMutation(m);
-          bw.flush();
-          // flush often to create multiple files to compact
-          client.tableOperations().flush(table1, null, null, true);
-        }
-      }
-
-      final AtomicReference<Exception> error = new AtomicReference<>();
-      Thread t = new Thread(() -> {
-        try {
-          IteratorSetting setting = new IteratorSetting(50, "sleepy", 
SlowIterator.class);
-          setting.addOption("sleepTime", "3000");
-          setting.addOption("seekSleepTime", "3000");
-          var cconf = new 
CompactionConfig().setWait(true).setIterators(List.of(setting));
-          client.tableOperations().compact(table1, cconf);
-        } catch (AccumuloSecurityException | TableNotFoundException | 
AccumuloException e) {
-          error.set(e);
-        }
-      });
-      t.start();
-      // when the compaction starts it will create a selected files column in 
the tablet, wait for
-      // that to happen
-      while (countTablets(table1, tm -> tm.getSelectedFiles() != null) == 0) {
-        Thread.sleep(1000);
-      }
-      client.tableOperations().cancelCompaction(table1);
-      t.join();
-      Exception e = error.get();
-      assertNotNull(e);
-      assertEquals(TableOperationsImpl.COMPACTION_CANCELED_MSG, 
e.getMessage());

Review Comment:
   good catch, added in 369f8d8



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