}
private void givenTwoFailedBucketAttempts_archivesTheThirdBucketAndTheTwoFailedBuckets()
throws IOException {
// Setup buckets
LocalBucket firstFailingBucket = TUtilsBucket.createBucket();
LocalBucket secondFailingBucket = TUtilsBucket.createBucket();
LocalBucket successfulBucket = TUtilsBucket.createBucket();
// Test
failingBucketFreezerWithoutRecovery.freezeBucket(firstFailingBucket
.getIndex(), firstFailingBucket.getDirectory().getAbsolutePath());
failingBucketFreezerWithoutRecovery.freezeBucket(secondFailingBucket
.getIndex(), secondFailingBucket.getDirectory().getAbsolutePath());
// Verify bucket archiving failed.
String firstBucketPath = pathResolver
.resolveArchivePath(firstFailingBucket);
String secondBucketPath = pathResolver
.resolveArchivePath(secondFailingBucket);
assertFalse(hadoopFileSystem.exists(new Path(firstBucketPath)));
assertFalse(hadoopFileSystem.exists(new Path(secondBucketPath)));
successfulBucketFreezerWithRecovery.freezeBucket(successfulBucket
.getIndex(), successfulBucket.getDirectory().getAbsolutePath());
TUtilsFunctional.waitForAsyncArchiving();
// Verification
String thirdBucketPath = pathResolver.resolveArchivePath(successfulBucket);
assertTrue(hadoopFileSystem.exists(new Path(firstBucketPath)));