Skip to content

Commit bc66860

Browse files
author
Ajay Kannan
committed
Minor fix in ITs
1 parent 9d201a0 commit bc66860

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/it/ITBigQueryTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,11 @@ public static void afterClass() throws ExecutionException, InterruptedException
197197
if (bigquery != null) {
198198
RemoteBigQueryHelper.forceDelete(bigquery, DATASET);
199199
}
200-
if (storage != null && !RemoteGcsHelper.forceDelete(storage, BUCKET, 10, TimeUnit.SECONDS)
201-
&& LOG.isLoggable(Level.WARNING)) {
202-
LOG.log(Level.WARNING, "Deletion of bucket {0} timed out, bucket is not empty", BUCKET);
200+
if (storage != null) {
201+
boolean wasDeleted = RemoteGcsHelper.forceDelete(storage, BUCKET, 10, TimeUnit.SECONDS);
202+
if (!wasDeleted && LOG.isLoggable(Level.WARNING)) {
203+
LOG.log(Level.WARNING, "Deletion of bucket {0} timed out, bucket is not empty", BUCKET);
204+
}
203205
}
204206
}
205207

gcloud-java-storage/src/test/java/com/google/gcloud/storage/it/ITStorageTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,11 @@ public static void beforeClass() {
8888

8989
@AfterClass
9090
public static void afterClass() throws ExecutionException, InterruptedException {
91-
if (storage != null && !RemoteGcsHelper.forceDelete(storage, BUCKET, 5, TimeUnit.SECONDS)
92-
&& log.isLoggable(Level.WARNING)) {
93-
log.log(Level.WARNING, "Deletion of bucket {0} timed out, bucket is not empty", BUCKET);
91+
if (storage != null) {
92+
boolean wasDeleted = RemoteGcsHelper.forceDelete(storage, BUCKET, 5, TimeUnit.SECONDS);
93+
if (!wasDeleted && log.isLoggable(Level.WARNING)) {
94+
log.log(Level.WARNING, "Deletion of bucket {0} timed out, bucket is not empty", BUCKET);
95+
}
9496
}
9597
}
9698

0 commit comments

Comments
 (0)