diff --git a/aws/s3/core/src/test/java/org/jclouds/aws/s3/commands/DeleteBucketIntegrationTest.java b/aws/s3/core/src/test/java/org/jclouds/aws/s3/commands/DeleteBucketIntegrationTest.java index fb8d36bd2c..977506ce37 100644 --- a/aws/s3/core/src/test/java/org/jclouds/aws/s3/commands/DeleteBucketIntegrationTest.java +++ b/aws/s3/core/src/test/java/org/jclouds/aws/s3/commands/DeleteBucketIntegrationTest.java @@ -24,6 +24,7 @@ package org.jclouds.aws.s3.commands; import org.jclouds.aws.s3.S3IntegrationTest; +import org.jclouds.util.Utils; import org.testng.annotations.Test; /** @@ -57,10 +58,20 @@ public class DeleteBucketIntegrationTest extends S3IntegrationTest { @Test void deleteBucketIfEmpty() throws Exception { - String bucketName = getScratchBucketName(); + final String bucketName = getScratchBucketName(); try { assert client.deleteBucketIfEmpty(bucketName); - assert !client.bucketExists(bucketName); + + assertEventually(new Runnable() { + public void run() { + try { + assert !client.bucketExists(bucketName) : "bucket " + bucketName + + " still exists"; + } catch (Exception e) { + Utils. rethrowIfRuntimeOrSameType(e); + } + } + }); } finally { returnScratchBucket(bucketName); } diff --git a/aws/s3/core/src/test/java/org/jclouds/aws/s3/commands/PutBucketLiveTest.java b/aws/s3/core/src/test/java/org/jclouds/aws/s3/commands/PutBucketLiveTest.java index e0f7b5a286..4ff79e69ee 100644 --- a/aws/s3/core/src/test/java/org/jclouds/aws/s3/commands/PutBucketLiveTest.java +++ b/aws/s3/core/src/test/java/org/jclouds/aws/s3/commands/PutBucketLiveTest.java @@ -95,14 +95,22 @@ public class PutBucketLiveTest extends S3IntegrationTest { */ @Test(groups = "live") void testEu() throws Exception { - String bucketName = getScratchBucketName(); + final String bucketName = getScratchBucketName(); try { deleteBucket(bucketName); client.putBucketIfNotExists(bucketName, createIn(LocationConstraint.EU).withBucketAcl(CannedAccessPolicy.PUBLIC_READ)) - .get(10, TimeUnit.SECONDS); - AccessControlList acl = client.getBucketACL(bucketName).get(10, TimeUnit.SECONDS); - assertTrue(acl.hasPermission(GroupGranteeURI.ALL_USERS, Permission.READ), acl.toString()); + .get(30, TimeUnit.SECONDS); + assertEventually(new Runnable() { + public void run() { + try { + AccessControlList acl = client.getBucketACL(bucketName).get(10, TimeUnit.SECONDS); + assertTrue(acl.hasPermission(GroupGranteeURI.ALL_USERS, Permission.READ), acl.toString()); + } catch (Exception e) { + Utils. rethrowIfRuntimeOrSameType(e); + } + } + }); // TODO: I believe that the following should work based on the above acl assertion passing. // However, it fails on 403 // URL url = new URL(String.format("https://%s.s3.amazonaws.com", bucketName));