From dd1863f7ff76888a889a44aa2e818da3564933e2 Mon Sep 17 00:00:00 2001 From: "adrian.f.cole" Date: Sat, 27 Jun 2009 20:45:01 +0000 Subject: [PATCH] s3 from ec2 seems to be more sensitive. Allow bucket empty to try twice instead of failing git-svn-id: http://jclouds.googlecode.com/svn/trunk@1478 3d8758e0-26b5-11de-8745-db77d3ebf521 --- .../test/java/org/jclouds/aws/s3/S3IntegrationTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 27e98c259e..1e0e3b4c57 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 @@ -223,7 +223,12 @@ public class S3IntegrationTest { public String getBucketName() throws InterruptedException, ExecutionException, TimeoutException { String bucketName = bucketNames.poll(30, TimeUnit.SECONDS); - emptyBucket(bucketName); + // retrying as inside EC2 it may take longer to reflect the contents of a bucket. + try { + emptyBucket(bucketName); + } catch (AssertionError e) { + emptyBucket(bucketName); + } assert bucketName != null : "unable to get a bucket for the test"; return bucketName; }