diff --git a/aws/s3/core/src/test/java/org/jclouds/aws/s3/S3IntegrationTest.java b/aws/s3/core/src/test/java/org/jclouds/aws/s3/S3IntegrationTest.java index 94a87a64a8..27e98c259e 100644 --- a/aws/s3/core/src/test/java/org/jclouds/aws/s3/S3IntegrationTest.java +++ b/aws/s3/core/src/test/java/org/jclouds/aws/s3/S3IntegrationTest.java @@ -288,11 +288,19 @@ public class S3IntegrationTest { private static final BlockingQueue bucketNames = new ArrayBlockingQueue( bucketCount); + /** + * There are a lot of retries here mainly from experience running inside amazon EC2. + */ @BeforeGroups(dependsOnMethods = { "setUpClient" }, groups = { "integration", "live" }) public void setUpBuckets(ITestContext context) throws Exception { synchronized (bucketNames) { if (bucketNames.peek() == null) { - this.deleteEverything(); + // try twice to delete everything + try { + deleteEverything(); + } catch (AssertionError e) { + deleteEverything(); + } for (; bucketIndex < bucketCount; bucketIndex++) { String bucketName = bucketPrefix + bucketIndex; try { @@ -330,7 +338,6 @@ public class S3IntegrationTest { if (metaDatum.getName().startsWith(bucketPrefix.toLowerCase())) { deleteBucket(metaDatum.getName()); } - } } catch (CancellationException e) { throw e;