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:
parent
b9c676cdc0
commit
25654df98b
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue