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 2022/08/30 20:37:45 UTC

[GitHub] [accumulo] EdColeman commented on a diff in pull request #2902: Attempt to make KerberosRenewalIT more stable

EdColeman commented on code in PR #2902:
URL: https://github.com/apache/accumulo/pull/2902#discussion_r958610947


##########
test/src/main/java/org/apache/accumulo/test/functional/KerberosRenewalIT.java:
##########
@@ -200,7 +199,21 @@ private void createReadWriteDrop(AccumuloClient client) throws TableNotFoundExce
           new Key("a", "b", "c").compareTo(entry.getKey(), PartialKey.ROW_COLFAM_COLQUAL),
           "Did not find the expected key");
       assertEquals("d", entry.getValue().toString());
-      client.tableOperations().delete(table);
     }
+    client.tableOperations().delete(table);
+  }
+
+  private String createTableAndReturnTableName(AccumuloClient client) throws AccumuloException,
+      AccumuloSecurityException, TableNotFoundException, TableExistsException {
+    final String tableName = getUniqueNames(1)[0] + "_table";
+    try {
+      client.tableOperations().create(tableName);
+    } catch (TableExistsException e) {
+      log.debug("Table {} already exists. Deleting and trying again.", tableName);
+      client.tableOperations().delete(tableName);

Review Comment:
   Do tableOperations wait for the operation to complete - or do they create a FATE op and return?  If the FATE op is launched, then this could end up with a race condition and end up throwing TableNotFound or another exception. If the FATE was in progress, the create fails because its there, the FATE completes and removes the table, then the delete fails becuase it does not exist.  Another strategy may be to pull the create / delete into functions that retry and pause a little a few times.
   



-- 
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-unsubscribe@accumulo.apache.org

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