Skip to content

Commit ad5746d

Browse files
Delete table if the test fails (#331)
1 parent c696e4a commit ad5746d

File tree

1 file changed

+5
-0
lines changed
  • bigtable/hbase/snippets/src/main/java/com/example/cloud/bigtable/helloworld

1 file changed

+5
-0
lines changed

bigtable/hbase/snippets/src/main/java/com/example/cloud/bigtable/helloworld/HelloWorld.java

+5
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ private static void doHelloWorld(String projectId, String instanceId) {
132132
} catch (IOException e) {
133133
System.err.println("Exception while running HelloWorld: " + e.getMessage());
134134
e.printStackTrace();
135+
if (admin.tableExists(tableName.getName())) {
136+
print("Cleaning up table");
137+
admin.disableTable(table.getName());
138+
admin.deleteTable(table.getName());
139+
}
135140
System.exit(1);
136141
}
137142

0 commit comments

Comments
 (0)