Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import io.grpc.StatusRuntimeException;
import java.util.List;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
Expand Down Expand Up @@ -71,6 +72,13 @@ public void setUp() throws InterruptedException {
testTable = createTestTable(testEnvRule.env().getTableAdminClient());
}

@After
public void tearDown() throws InterruptedException {
if (testTable != null) {
testEnvRule.env().getTableAdminClient().deleteTable(testTable.getId());
}
}

@Test
public void createLogicalViewAndGetLogicalViewTest() {
String logicalViewId = prefixGenerator.newPrefix();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public void testOnAuthorizedView()
.env()
.getTableAdminClient()
.deleteAuthorizedView(testAuthorizedView.getTableId(), testAuthorizedView.getId());

testEnvRule.env().getTableAdminClient().deleteTable(testAuthorizedView.getTableId());
}

private static AuthorizedView createPreSplitTableAndAuthorizedView() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,17 @@ void cleanUpStale() throws ExecutionException, InterruptedException, IOException
private void cleanupStaleTables(String stalePrefix) {
for (String tableId : env().getTableAdminClient().listTables()) {
if (!tableId.startsWith(PrefixGenerator.PREFIX)) {
LOGGER.info("Skip cleaning up table: " + tableId);
continue;
}
if (stalePrefix.compareTo(tableId) > 0) {
LOGGER.info("Preparing stale table for delete: " + tableId);
prepTableForDelete(tableId);
try {
LOGGER.info("Deleting stable table: " + tableId);
env().getTableAdminClient().deleteTable(tableId);
} catch (NotFoundException ignored) {

} catch (NotFoundException e) {
LOGGER.log(Level.WARNING, "Deleting stale table failed: " + tableId, e);
}
}
}
Expand Down
Loading