Index: hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.java =================================================================== --- hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.java (revision 1507674) +++ hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestFlushSnapshotFromClient.java (working copy) @@ -137,6 +137,10 @@ } catch (IOException e) { LOG.warn("Failure to delete archive directory", e); } + for (SnapshotDescription snapshot: UTIL.getHBaseAdmin().listSnapshots()) { + UTIL.getHBaseAdmin().deleteSnapshot(snapshot.getName()); + } + SnapshotTestingUtils.assertNoSnapshots(UTIL.getHBaseAdmin()); } @AfterClass @@ -194,10 +198,6 @@ SnapshotTestingUtils.confirmSnapshotValid(snapshots.get(0), TABLE_NAME, TEST_FAM, rootDir, admin, fs, false, new Path(rootDir, HConstants.HREGION_LOGDIR_NAME), snapshotServers); - - admin.deleteSnapshot(snapshot); - snapshots = admin.listSnapshots(); - SnapshotTestingUtils.assertNoSnapshots(admin); } @Test @@ -246,16 +246,6 @@ FSUtils.getRootDir(UTIL.getConfiguration()), LOG); // make sure we get the snapshot SnapshotTestingUtils.assertOneSnapshotThatMatches(admin, snapshot); - - // test that we can delete the snapshot - admin.deleteSnapshot(snapshot.getName()); - LOG.info(" === Async Snapshot Deleted ==="); - FSUtils.logFileSystemState(UTIL.getTestFileSystem(), - FSUtils.getRootDir(UTIL.getConfiguration()), LOG); - // make sure we don't have any snapshots - SnapshotTestingUtils.assertNoSnapshots(admin); - LOG.info(" === Async Snapshot Test Completed ==="); - } @Test @@ -309,10 +299,6 @@ // test that we can delete the snapshot UTIL.deleteTable(cloneAfterMergeName); UTIL.deleteTable(cloneBeforeMergeName); - admin.deleteSnapshot(snapshotBeforeMergeName); - - // make sure we don't have any snapshots - SnapshotTestingUtils.assertNoSnapshots(admin); } @Test @@ -358,10 +344,6 @@ // test that we can delete the snapshot UTIL.deleteTable(cloneName); - admin.deleteSnapshot(snapshotName); - - // make sure we don't have any snapshots - SnapshotTestingUtils.assertNoSnapshots(admin); } /** @@ -417,15 +399,6 @@ // make sure we have some file references assertTrue(fs.listStatus(familyDir).length > 0); } - - // test that we can delete the snapshot - admin.deleteSnapshot(snapshotName); - FSUtils.logFileSystemState(UTIL.getTestFileSystem(), - FSUtils.getRootDir(UTIL.getConfiguration()), LOG); - - // make sure we don't have any snapshots - SnapshotTestingUtils.assertNoSnapshots(admin); - LOG.debug("------- Flush-Snapshot Create List Destroy-------------"); } /** @@ -534,10 +507,6 @@ assertTrue("We expect at least 1 snapshot of table1 ", t1SnapshotsCount > 0); assertTrue("We expect at least 1 snapshot of table2 ", t2SnapshotsCount > 0); - // delete snapshots so subsequent tests are clean. - for (SnapshotDescription ss : taken) { - admin.deleteSnapshot(ss.getName()); - } UTIL.deleteTable(TABLE2_NAME); }