@Test
public void testRelativeDelete() throws Exception {

  Random r = new Random();
  long seed = r.nextLong();
  r.setSeed(seed);
  System.out.println("SEED: " + seed);
  List<Path> baseDirs = buildDirs(r, base, 4);
  createDirs(new Path("."), baseDirs);
  List<Path> content = buildDirs(r, new Path("."), 10);
  for (Path b : baseDirs) {
    createDirs(b, content);
  }
  DeletionService del =
    new DeletionService(new FakeDefaultContainerExecutor());
  try {
    del.init(new Configuration());
    del.start();
    for (Path p : content) {
      assertTrue(lfs.util().exists(new Path(baseDirs.get(0), p)));
      FileDeletionTask deletionTask = new FileDeletionTask(del,
          (Long.parseLong(p.getName()) % 2) == 0 ? null : "dingo", p,
          baseDirs);
      del.delete(deletionTask);
    }
    int msecToWait = 20 * 1000;
    for (Path p : baseDirs) {
      for (Path q : content) {
        Path fp = new Path(p, q);
        while (msecToWait > 0 && lfs.util().exists(fp)) {
          Thread.sleep(100);
          msecToWait -= 100;
        }
        assertFalse(lfs.util().exists(fp));
      }
    }
  } finally {
    del.stop();
  }
}