diff --git a/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/Bidi.java b/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/Bidi.java index 2375d7f8d2..b1a0dda27f 100644 --- a/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/Bidi.java +++ b/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/Bidi.java @@ -70,6 +70,7 @@ public String call() throws Exception { Instant endTime = clock.instant(); Duration elapsedTimeWrite = Duration.between(startTime, endTime); printResult("BIDI", created, elapsedTimeWrite); + StorageSharedBenchmarkingUtils.cleanupObject(storageClient, created); return "OK"; } diff --git a/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/StorageSharedBenchmarkingUtils.java b/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/StorageSharedBenchmarkingUtils.java index 247b97f055..57f6245b14 100644 --- a/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/StorageSharedBenchmarkingUtils.java +++ b/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/StorageSharedBenchmarkingUtils.java @@ -24,7 +24,7 @@ class StorageSharedBenchmarkingUtils { public static long SSB_SIZE_THRESHOLD_BYTES = 1048576; public static int DEFAULT_NUMBER_OF_READS = 3; - public static void cleanupObject(Storage storage, Blob created) { + public static void cleanupObject(Storage storage, BlobInfo created) { storage.delete( created.getBlobId(), Storage.BlobSourceOption.generationMatch(created.getGeneration())); } diff --git a/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/W1R3.java b/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/W1R3.java index cce2258e56..1abde37e1e 100644 --- a/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/W1R3.java +++ b/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/W1R3.java @@ -82,7 +82,7 @@ public String call() { printResult("READ[" + i + "]", created, elapsedTimeDownload); } } - StorageSharedBenchmarkingUtils.cleanupObject(storage, created); + StorageSharedBenchmarkingUtils.cleanupObject(storage, created.asBlobInfo()); } catch (Exception e) { CloudMonitoringResult result = CloudMonitoringResult.newBuilder()