Skip to content

Commit

Permalink
chore: Fix broken sample tests (#2578)
Browse files Browse the repository at this point in the history
* chore: Fix broken sample tests
  • Loading branch information
sydney-munro committed Jun 13, 2024
1 parent 3030081 commit adc14b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void run() {
}
forceDelete(storage, bucket.getName());
} catch (Exception e) {
// Ignore the exception, maybe the bucket is being deleted by someone else.
log.info("Failed to clean buckets " + e.getMessage());
}
}
}
Expand Down Expand Up @@ -298,6 +298,7 @@ public Boolean call() {
}
return true;
} catch (StorageException e) {
log.warning("Caught exception in Delete Bucket Task" + e.getMessage());
if (e.getCode() == 409) {
try {
Thread.sleep(500);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ public static void beforeClass() {
@AfterClass
public static void afterClass() throws ExecutionException, InterruptedException {
if (storage != null) {
// In beforeClass, we make buckets auto-delete blobs older than a day old.
// Here, delete all buckets older than 2 days. They should already be empty and easy.
long cleanTime = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(2);
long cleanTimeout = System.currentTimeMillis() - TimeUnit.MINUTES.toMillis(1);
RemoteStorageHelper.cleanBuckets(storage, cleanTime, cleanTimeout);

boolean wasDeleted = RemoteStorageHelper.forceDelete(storage, BUCKET, 1, TimeUnit.MINUTES);
if (!wasDeleted && log.isLoggable(Level.WARNING)) {
log.log(Level.WARNING, "Deletion of bucket {0} timed out, bucket is not empty", BUCKET);
Expand Down

0 comments on commit adc14b9

Please sign in to comment.