HBASE-23862 Fix flaky TestSnapshotFromMaster in 1.x versions (#1181)

Backport HBASE-23658 - Fix flaky TestSnapshotFromMaster

(cherry picked from commit e750d2c7af)

Signed-off-by: Guanghao Zhang <zghaobac@gmail.com>
This commit is contained in:
Sakthi 2020-02-19 19:51:07 -08:00 committed by GitHub
parent b9c676cdc0
commit 25654df98b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -365,7 +365,7 @@ public class TestSnapshotFromMaster {
isSnapshotCleanupEnabledResponse =
master.getMasterRpcServices().isSnapshotCleanupEnabled(null,
isSnapshotCleanupEnabledRequest);
Assert.assertFalse(isSnapshotCleanupEnabledResponse.getEnabled());
assertFalse(isSnapshotCleanupEnabledResponse.getEnabled());
}
/**
@ -530,8 +530,11 @@ public class TestSnapshotFromMaster {
return UTIL.getHBaseAdmin().listSnapshots(Pattern.compile(snapshotName)).size() == 1;
}
});
assertTrue(master.getSnapshotManager().isTakingAnySnapshot());
Thread.sleep(11 * 1000L);
assertFalse(master.getSnapshotManager().isTakingAnySnapshot());
UTIL.waitFor(30000, new Predicate<Exception>() {
@Override
public boolean evaluate() throws Exception {
return !master.getSnapshotManager().isTakingAnySnapshot();
}
});
}
}