storage: relax bucket and object deletion

Currently, TestIntegration_UpdateRetentionExpirationTime creates a
bucket and an object, sets a bucket RetentionPeriod, checks the
RetentionPeriod was set in the server, then sets the RetentionPeriod to
0 and deletes the bucket and object.

However, a RetentionPeriod of less than a day is explicitly called out
as best effort and not guaranteed.

Therefore, occasionally our tests fail in the cleanup step because the
RetentionPeriod is still active (the 0 has not been propogated).

This CL changes the test to log the error rather than fail on the error.
The next time tests get run, the test init step tries to clean up
outstanding buckets, so we'll eventually have the cleanup behavior.

Fixes #1284

Change-Id: I28572bbfddbaf1df3e56dd163dbff1e7a64667f6
Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/39190
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
diff --git a/storage/integration_test.go b/storage/integration_test.go
index 0edef8c..cf4bb0b 100644
--- a/storage/integration_test.go
+++ b/storage/integration_test.go
@@ -2220,8 +2220,16 @@
 
 	defer func() {
 		h.mustUpdateBucket(bkt, BucketAttrsToUpdate{RetentionPolicy: &RetentionPolicy{RetentionPeriod: 0}})
-		h.mustDeleteObject(obj)
-		h.mustDeleteBucket(bkt)
+
+		// RetentionPeriod of less than a day is explicitly called out
+		// as best effort and not guaranteed, so let's log problems deleting
+		// objects instead of failing.
+		if err := obj.Delete(context.Background()); err != nil {
+			t.Logf("%s: object delete: %v", loc(), err)
+		}
+		if err := bkt.Delete(context.Background()); err != nil {
+			t.Logf("%s: bucket delete: %v", loc(), err)
+		}
 	}()
 
 	attrs := h.mustObjectAttrs(obj)