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
This commit is contained in:
adrian.f.cole 2009-06-27 20:45:01 +00:00
parent d5f6cc6f21
commit dd1863f7ff
1 changed files with 6 additions and 1 deletions

View File

@ -223,7 +223,12 @@ public class S3IntegrationTest {
public String getBucketName() throws InterruptedException, ExecutionException, TimeoutException { public String getBucketName() throws InterruptedException, ExecutionException, TimeoutException {
String bucketName = bucketNames.poll(30, TimeUnit.SECONDS); String bucketName = bucketNames.poll(30, TimeUnit.SECONDS);
// retrying as inside EC2 it may take longer to reflect the contents of a bucket.
try {
emptyBucket(bucketName); emptyBucket(bucketName);
} catch (AssertionError e) {
emptyBucket(bucketName);
}
assert bucketName != null : "unable to get a bucket for the test"; assert bucketName != null : "unable to get a bucket for the test";
return bucketName; return bucketName;
} }