Skip to content

Commit

Permalink
test: Add null check in teardown (#752)
Browse files Browse the repository at this point in the history
* test: Add null check in teardown

* test: Remove extra exception type

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: Updated shared-configuration in pom.xml

* chore: revert changes to auto-generated pom.xml files

* chore: update changes to auto-generated pom.xml files

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
kweinmeister and gcf-owl-bot[bot] authored Dec 22, 2021
1 parent 56939de commit a5960a4
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,19 @@ public void setUp()
@After
public void tearDown() throws InterruptedException, ExecutionException, IOException {
// delete the temp dataset
DatasetServiceSettings datasetServiceSettings =
DatasetServiceSettings.newBuilder()
.setEndpoint("us-central1-aiplatform.googleapis.com:443")
.build();
try (DatasetServiceClient datasetServiceClient =
DatasetServiceClient.create(datasetServiceSettings)) {
DatasetName datasetName = DatasetName.of(PROJECT, LOCATION, datasetId);
if (datasetId != null) {
DatasetServiceSettings datasetServiceSettings =
DatasetServiceSettings.newBuilder()
.setEndpoint("us-central1-aiplatform.googleapis.com:443")
.build();
try (DatasetServiceClient datasetServiceClient =
DatasetServiceClient.create(datasetServiceSettings)) {
DatasetName datasetName = DatasetName.of(PROJECT, LOCATION, datasetId);

OperationFuture<Empty, DeleteOperationMetadata> operationFuture =
datasetServiceClient.deleteDatasetAsync(datasetName);
operationFuture.get();
OperationFuture<Empty, DeleteOperationMetadata> operationFuture =
datasetServiceClient.deleteDatasetAsync(datasetName);
operationFuture.get();
}
}
System.out.flush();
System.setOut(originalPrintStream);
Expand Down

0 comments on commit a5960a4

Please sign in to comment.