HBASE-6707 TEST org.apache.hadoop.hbase.backup.example.TestZooKeeperTableArchiveClient.testMultipleTables flaps; ADDENDUM v4 -- I FORGOT THIS BIT
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1403539 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
27f9a5cd7b
commit
e7d4f965a1
|
@ -243,8 +243,9 @@ public class TestZooKeeperTableArchiveClient {
|
||||||
assertTrue("Didn't archive files for:" + STRING_TABLE_NAME, initialCountForPrimary > 0);
|
assertTrue("Didn't archive files for:" + STRING_TABLE_NAME, initialCountForPrimary > 0);
|
||||||
assertTrue("Didn't archive files for:" + otherTable, initialCountForOtherTable > 0);
|
assertTrue("Didn't archive files for:" + otherTable, initialCountForOtherTable > 0);
|
||||||
|
|
||||||
// run the cleaners
|
// run the cleaners, checking for each of the directories + files (both should be deleted and
|
||||||
CountDownLatch finished = setupCleanerWatching(delegate, cleaners, files.size());
|
// need to be checked) in 'otherTable' and the files (which should be retained) in the 'table'
|
||||||
|
CountDownLatch finished = setupCleanerWatching(delegate, cleaners, files.size() + 3);
|
||||||
// run the cleaner
|
// run the cleaner
|
||||||
cleaner.start();
|
cleaner.start();
|
||||||
// wait for the cleaner to check all the files
|
// wait for the cleaner to check all the files
|
||||||
|
@ -335,10 +336,12 @@ public class TestZooKeeperTableArchiveClient {
|
||||||
@Override
|
@Override
|
||||||
public Boolean answer(InvocationOnMock invocation) throws Throwable {
|
public Boolean answer(InvocationOnMock invocation) throws Throwable {
|
||||||
counter[0]++;
|
counter[0]++;
|
||||||
LOG.debug(counter[0] + "/ " + expected + ") Mocking call to isFileDeletable");
|
LOG.debug(counter[0] + "/ " + expected + ") Wrapping call to isFileDeletable for file: "
|
||||||
if (counter[0] > expected) finished.countDown();
|
+ invocation.getArguments()[0]);
|
||||||
return (Boolean) invocation.callRealMethod();
|
|
||||||
|
|
||||||
|
Boolean ret = (Boolean) invocation.callRealMethod();
|
||||||
|
if (counter[0] >= expected) finished.countDown();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
}).when(delegateSpy).isFileDeletable(Mockito.any(Path.class));
|
}).when(delegateSpy).isFileDeletable(Mockito.any(Path.class));
|
||||||
cleaners.set(0, delegateSpy);
|
cleaners.set(0, delegateSpy);
|
||||||
|
@ -353,7 +356,10 @@ public class TestZooKeeperTableArchiveClient {
|
||||||
*/
|
*/
|
||||||
private List<Path> getAllFiles(FileSystem fs, Path dir) throws IOException {
|
private List<Path> getAllFiles(FileSystem fs, Path dir) throws IOException {
|
||||||
FileStatus[] files = FSUtils.listStatus(fs, dir, null);
|
FileStatus[] files = FSUtils.listStatus(fs, dir, null);
|
||||||
if (files == null) return null;
|
if (files == null) {
|
||||||
|
LOG.warn("No files under:" + dir);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
List<Path> allFiles = new ArrayList<Path>();
|
List<Path> allFiles = new ArrayList<Path>();
|
||||||
for (FileStatus file : files) {
|
for (FileStatus file : files) {
|
||||||
|
|
Loading…
Reference in New Issue