keith-turner commented on code in PR #5412:
URL: https://github.com/apache/accumulo/pull/5412#discussion_r1999699048


##########
test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction_2_IT.java:
##########
@@ -301,6 +305,46 @@ public void testDeleteTableCancelsUserExternalCompaction() 
throws Exception {
     }
   }
 
+  @Test
+  public void testDeleteTableCancelsSleepingExternalCompaction() throws 
Exception {
+    
getCluster().getClusterControl().startCoordinator(CompactionCoordinator.class);
+    getCluster().getClusterControl().startCompactors(Compactor.class, 1, 
QUEUE4);
+
+    String table1 = this.getUniqueNames(1)[0];
+    try (AccumuloClient client =
+        Accumulo.newClient().from(getCluster().getClientProperties()).build()) 
{
+
+      createTable(client, table1, "cs4");
+      TableId tid = getCluster().getServerContext().getTableId(table1);
+      writeData(client, table1);
+
+      // The purpose of this test to ensure the sleeping thread is 
interrupted. The only way the
+      // compactor can cancel this compaction is if it interrupts the sleeping 
thread.
+      IteratorSetting iteratorSetting = new IteratorSetting(100, 
SlowIterator.class);
+      // Sleep so long that the test would timeout if the thread is not 
interrupted.
+      SlowIterator.setSleepTime(iteratorSetting, 600000);
+      SlowIterator.setSeekSleepTime(iteratorSetting, 600000);
+      SlowIterator.sleepUninterruptibly(iteratorSetting, false);

Review Comment:
   Locally tried changing this to true and the test will hang forever because 
the thread can not be interrupted.



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