Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix broken sample tests #2578

Merged
merged 2 commits into from
Jun 13, 2024
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 @@ -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
Loading